Merge branch 'NN-complr-tech:course-spring-2024' into course-spring-2024 #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build LLVM | |
on: [push, pull_request] | |
jobs: | |
ubuntu-gcc-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup environment | |
run: | | |
sudo apt-get install -y \ | |
build-essential \ | |
ninja-build \ | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
max-size: 500M | |
key: ccache-${{ github.job }} | |
- name: Build | |
run: | | |
cmake -S llvm -B build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_ENABLE_PROJECTS='clang;mlir' \ | |
-DLLVM_ENABLE_ASSERTIONS=ON \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-G Ninja | |
cmake --build build -j $(nproc) | |
- name: Test | |
run: | | |
cmake --build build -t check-llvm check-clang check-mlir -j $(nproc) | |
macos-build: | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup environment | |
run: | | |
brew install \ | |
ninja | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
max-size: 500M | |
key: ccache-${{ github.job }} | |
- name: Build | |
run: | | |
cmake -S llvm -B build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_ENABLE_PROJECTS='clang;mlir' \ | |
-DLLVM_ENABLE_ASSERTIONS=ON \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-G Ninja | |
cmake --build build -j $(nproc) | |
- name: Test | |
run: | | |
cmake --build build -t check-llvm check-clang check-mlir -j $(nproc) | |
windows-build: | |
runs-on: windows-latest | |
steps: | |
- name: Setup Windows | |
if: startsWith(matrix.os, 'windows') | |
uses: llvm/actions/setup-windows@main | |
with: | |
arch: amd64 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ inputs.python_version }} | |
- name: Install Ninja | |
uses: llvm/actions/install-ninja@main | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 250 | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
# A full build of llvm, clang, lld, and lldb takes about 250MB | |
# of ccache space. There's not much reason to have more than this, | |
# because we usually won't need to save cache entries from older | |
# builds. Also, there is an overall 10GB cache limit, and each | |
# run creates a new cache entry so we want to ensure that we have | |
# enough cache space for all the tests to run at once and still | |
# fit under the 10 GB limit. | |
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174 | |
max-size: 2G | |
key: ${{ matrix.os }} | |
variant: sccache | |
- name: Build and Test | |
shell: bash | |
id: build-llvm | |
run: | | |
builddir="$(pwd)"/build | |
echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT" | |
cmake -G Ninja \ | |
-B "$builddir" \ | |
-S llvm \ | |
-DLLVM_ENABLE_PROJECTS="clang" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_ENABLE_ASSERTIONS=ON \ | |
-DLLDB_INCLUDE_TESTS=OFF \ | |
-DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
${{ inputs.extra_cmake_args }} | |
ninja -C "$builddir" all |