on-llvm-update #461
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: Verify | |
concurrency: verify | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
repository_dispatch: | |
types: [on-llvm-update] | |
jobs: | |
build-debug: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install build dependencies. | |
run: | | |
sudo apt-get install cmake ninja-build lld | |
- name: Check out the compiler. | |
uses: actions/checkout@v2 | |
with: | |
repository: 'llvm-mos/llvm-mos' | |
path: 'llvm-mos' | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
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. | |
max-size: 500M | |
key: sccache-${{ matrix.os }} | |
variant: sccache | |
- name: Build the compiler. | |
run: | | |
cd llvm-mos | |
cmake -C clang/cmake/caches/MOS.cmake -G Ninja -S llvm -B build -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_USE_LINKER=lld -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache | |
cd build | |
cmake --build . --target builtins clang lld llvm-ar llvm-ranlib llvm-size llvm-mlb | |
- name: Archive the compiler. | |
run: | | |
for dir in build/{bin,lib/clang} llvm/utils; do | |
mkdir -p staging/llvm-mos/$(dirname $dir) | |
mv llvm-mos/$dir staging/llvm-mos/$(dirname $dir) | |
done | |
rm -rf llvm-mos | |
cd staging | |
tar --zstd -cf ../compiler.tar.zst llvm-mos | |
cd .. | |
rm -rf staging | |
- name: Upload the compiler. | |
uses: actions/upload-artifact@v4 | |
with: | |
name: compiler | |
path: compiler.tar.zst | |
verify: | |
needs: build-debug | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
opt: [O0, O3, Os, Oz] | |
fail-fast: false | |
steps: | |
- name: Install build dependencies. | |
run: | | |
sudo apt-get install cmake ninja-build llvm | |
- name: Download the compiler. | |
uses: actions/download-artifact@v4 | |
with: | |
name: compiler | |
- name: Extract the compiler. | |
run: tar -xpf compiler.tar.zst | |
- name: Check out the SDK. | |
uses: actions/checkout@v2 | |
with: | |
repository: 'llvm-mos/llvm-mos-sdk' | |
path: 'llvm-mos-sdk' | |
- name: Build the SDK. | |
run: | | |
cd llvm-mos-sdk | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/llvm-mos/build -G "Ninja" .. | |
ninja install | |
- name: Check out the test suite. | |
uses: actions/checkout@v2 | |
with: | |
path: 'llvm-test-suite' | |
- name: Verify the test suite. | |
run: | | |
cd llvm-test-suite | |
mkdir build | |
cd build | |
cmake -DLLVM_MOS=$GITHUB_WORKSPACE/llvm-mos/build \ | |
-C../cmake/caches/${{ matrix.opt }}.cmake \ | |
-C../cmake/caches/target-mos.cmake \ | |
-DTEST_SUITE_ARCH_FLAGS="-Wl,-mllvm,-verify-machineinstrs" \ | |
-G Ninja \ | |
.. | |
ninja | |
- name: Run the test suite. | |
run: | | |
cd llvm-test-suite/build | |
$GITHUB_WORKSPACE/llvm-mos/build/bin/llvm-lit . |