Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand build-and-test matrix. #9

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 102 additions & 83 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -25,23 +25,36 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubuntu-20.04 - clang
- name: ubuntu-20.04 - clang 10
os: ubuntu-20.04
cc_compiler: clang
cxx_compiler: clang++
- name: ubuntu-22.04 - clang
cc_compiler: clang-10
cxx_compiler: clang++-10
- name: ubuntu-22.04 - clang 13
os: ubuntu-22.04
cc_compiler: clang
cxx_compiler: clang++

- name: ubuntu-20.04 - gcc
cc_compiler: clang-13
cxx_compiler: clang++-13
- name: ubuntu-24.04 - clang 16
os: ubuntu-24.04
cc_compiler: clang-16
cxx_compiler: clang++-16

- name: ubuntu-20.04 - gcc 10
os: ubuntu-20.04
cc_compiler: gcc
cxx_compiler: g++
- name: ubuntu-22.04 - gcc
cc_compiler: gcc-10
cxx_compiler: g++-10
- name: ubuntu-22.04 - gcc 10
os: ubuntu-22.04
cc_compiler: gcc
cxx_compiler: g++
cc_compiler: gcc-10
cxx_compiler: g++-10
- name: ubuntu-24.04 - gcc 12
os: ubuntu-24.04
cc_compiler: gcc-12
cxx_compiler: g++-12

- name: macos-14 - clang
os: macos-14
cc_compiler: clang
cxx_compiler: clang++
Comment on lines +54 to +57
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also tested macos-12 and macos-13:

Proceeding with what works out of the box for now.


- name: windows-2019 - msvc
os: windows-2019
@@ -71,73 +84,79 @@ jobs:
shell: bash

steps:

###########################################################################
# OS specific setup
###########################################################################

- name: Install dependencies (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install cmake clang ninja-build
export CC=${{ matrix.cc_compiler }}
export CXX=${{ matrix.cxx_compiler }}

- name: Configure MSVC (Windows)
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'msvc')
uses: ilammy/[email protected]

- name: Configure clang (Windows)
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'clang')
run: |
choco install ninja --yes
echo "CC='C:\Program Files\LLVM\bin\clang.exe'" >> $GITHUB_ENV
echo "CXX='C:\Program Files\LLVM\bin\clang++.exe'" >> $GITHUB_ENV

- name: Configure GCC (Windows)
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'gcc')
uses: egor-tensin/setup-mingw@v2
with:
version: 12.2.0

###########################################################################
# General setup
###########################################################################

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install IREE compiler
run: |
python -m pip install iree-compiler==20240724.964
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize submodules
run : |
git \
-c submodule."third_party/llvm-project".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."third_party/torch-mlir".update=none \
submodule update --init --recursive

###########################################################################
# Build and test
###########################################################################

- name: Build sample
run: |
cmake -B build/ -G Ninja
cmake --build build/ --target hello_world

- name: Compile sample module
run: |
iree-compile \
--iree-hal-target-backends=llvm-cpu \
simple_mul.mlir \
-o build/simple_mul.vmfb

- name: Test execution
run: |
./build/hello_world local-sync build/simple_mul.vmfb
###########################################################################
# OS specific setup
###########################################################################

- name: (Linux) Install dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install ninja-build
echo "CC=${{ matrix.cc_compiler }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx_compiler }}" >> $GITHUB_ENV

- name: (macOS) Install dependencies
if: contains(matrix.os, 'macos')
run: |
brew install ninja
echo "CC=${{ matrix.cc_compiler }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx_compiler }}" >> $GITHUB_ENV

- name: (Windows) Configure MSVC
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'msvc')
uses: ilammy/[email protected]

- name: (Windows) Configure clang
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'clang')
run: |
choco install ninja --yes
echo "CC='C:\Program Files\LLVM\bin\clang.exe'" >> $GITHUB_ENV
echo "CXX='C:\Program Files\LLVM\bin\clang++.exe'" >> $GITHUB_ENV

- name: (Windows) Configure GCC
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'gcc')
uses: egor-tensin/setup-mingw@v2
with:
version: 12.2.0

###########################################################################
# General setup
###########################################################################

- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.11"
- name: Install IREE compiler
run: |
python -m pip install iree-compiler==20240724.964
- name: Checkout repository
uses: actions/[email protected]
- name: Initialize submodules
run: |
git \
-c submodule."third_party/llvm-project".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."third_party/torch-mlir".update=none \
submodule update --init --recursive

###########################################################################
# Build and test
###########################################################################

- name: Build sample
run: |
cmake -B build/ -G Ninja
cmake --build build/ --target hello_world

- name: Compile sample module
run: |
iree-compile \
--iree-hal-target-backends=llvm-cpu \
simple_mul.mlir \
-o build/simple_mul.vmfb

- name: Test execution
run: |
./build/hello_world local-sync build/simple_mul.vmfb