tmp #420
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: CI | |
on: [push, pull_request] | |
env: | |
KERNELS: > | |
3.10.0-514.el7 | |
3.10.0-693.el7 | |
3.10.0-862.el7 | |
3.10.0-957.el7 | |
4.18.0-80.el8 | |
4.18.0-147.el8 | |
4.18.0-193.el8 | |
4.18.0-240.el8 | |
3.10 | |
4.11 | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
llvm: [9, 10, 11, 12, 13, 14, 15, 16, 17] | |
env: | |
- CC: gcc-9 | |
CXX: g++-9 | |
asan: [OFF] | |
regression-tests: [true] | |
include: | |
- llvm: 17 | |
env: | |
CC: clang | |
CXX: clang++ | |
asan: OFF | |
regression-tests: true | |
- llvm: 17 | |
env: | |
CC: gcc-9 | |
CXX: g++-9 | |
asan: ON | |
regression-tests: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v10 | |
- uses: DeterminateSystems/magic-nix-cache-action@v4 | |
- name: Delete unused software | |
# This is necessary for running CScope database build as it takes | |
# a lot of disk space and the runners die silently when out of space. | |
run: | | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
- name: Restore Test Data | |
uses: actions/cache/restore@v4 | |
id: cache-test-data | |
if: matrix.regression-tests | |
with: | |
path: tests/regression/test_data | |
key: test-data-llvm${{ matrix.llvm }}-${{ hashFiles('tests/regression/test_specs/*') }} | |
# Download kernel sources: | |
# - if test_data is cached, we only need the kernel for unit tests | |
# - if test_data is not cached, we need all kernels | |
- name: Download Kernel for Unit Tests | |
if: | | |
matrix.regression-tests && | |
steps.cache-test-data.outputs.cache-hit == 'true' | |
run: | |
nix develop .#test-kernel-buildenv --command bash -c \ | |
"rhel-kernel-get 3.10.0-957.el7 --output-dir kernel" | |
- name: Download Kernels | |
if: | | |
matrix.regression-tests && | |
steps.cache-test-data.outputs.cache-hit != 'true' | |
run: | | |
mkdir kernel | |
for k in $KERNELS; do | |
nix develop .#test-kernel-buildenv --command bash -c \ | |
"rhel-kernel-get $k --output-dir kernel" | |
done | |
- name: Prepare Build Environment | |
run: | | |
mkdir -p ${{ github.workspace }}/build | |
- name: Configure and Build | |
env: ${{ matrix.env }} | |
run: > | |
nix develop .#diffkemp-llvm${{ matrix.llvm }} --command bash -c | |
"cmake -B build ${{ github.workspace }} -GNinja -DSANITIZE_ADDRESS=${{ matrix.asan }} && | |
ninja -C build" | |
- name: Run SimpLL Unit Tests | |
run: > | |
nix develop .#diffkemp-llvm${{ matrix.llvm }} --command | |
ninja test -C build | |
- name: Run Tests | |
if: matrix.regression-tests | |
shell: bash | |
run: > | |
nix develop .#diffkemp-llvm${{ matrix.llvm }} --command bash -c | |
${{ github.workspace }}/build/bin/run_pytest_tests.py -v | |
- name: Cache Test Data | |
if: matrix.regression-tests | |
uses: actions/cache@v4 | |
with: | |
path: tests/regression/test_data | |
key: test-data-llvm${{ matrix.llvm }}-${{ hashFiles('tests/regression/test_specs/*') }} |