lean4-htt/.github/workflows/ci.yml
Sebastian Ullrich a6fbf3c20e refactor: make stages internally consistent by compiling the stageN lib with the stageN compiler, rename static libraries
The old stage1 is now stage0.5, which at least suggests that it's not an entirely consistent stage in general
2020-05-14 23:13:51 +02:00

108 lines
3.9 KiB
YAML

name: CI
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# NOTE: must list all targets in `include` here to activate them
name: [Linux, "Linux Debug", "Linux fsanitize", "Linux LLVM=ON", macOS, Windows]
include:
- name: Linux
os: ubuntu-latest
check-stage3: true
test-speedcenter: true
- name: Linux Debug
os: ubuntu-latest
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Debug
- name: Linux fsanitize
os: ubuntu-latest
# turn off custom allocator to make LSAN do its magic
CMAKE_OPTIONS: -DLEAN_EXTRA_CXX_FLAGS=-fsanitize=address,undefined -DLEANC_EXTRA_FLAGS=-fsanitize=address,undefined -DSMALL_ALLOCATOR=OFF
- name: Linux LLVM=ON
os: ubuntu-latest
CMAKE_OPTIONS: -DLLVM=ON
- name: macOS
os: macos-latest
- name: Windows
os: windows-latest
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
# complete all jobs
fail-fast: false
env:
# must be inside workspace
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
# current cache limit
CCACHE_MAXSIZE: 200M
CMAKE_OPTIONS: ${{ matrix.CMAKE_OPTIONS }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v8
if: matrix.os != 'windows-latest'
- name: Install MSYS2
uses: numworks/setup-msys2@v1
if: matrix.os == 'windows-latest'
# binaries segfault without this step (?!), must be separate step because it might update the MSYS2 runtime
- name: Update MSYS2
run: msys2do pacman -Syu --noconfirm
if: matrix.os == 'windows-latest'
- name: Cache
uses: actions/cache@v1
with:
path: .ccache
key: ${{ matrix.name }}-build-${{ github.sha }}
# fall back to (latest) previous cache
restore-keys: |
${{ matrix.name }}-build
- name: Setup
run: |
# open shell once for initial setup
nix-shell --run true
if: matrix.os != 'windows-latest'
- name: Setup
run: msys2do pacman --noconfirm -S make python mingw-w64-x86_64-cmake mingw-w64-x86_64-clang mingw-w64-x86_64-ccache git diffutils
if: matrix.os == 'windows-latest'
# remove problematic tests for sanitized build
- name: Pre build
run: rm tests/compiler/StackOverflow.lean tests/compiler/StackOverflowTask.lean
if: matrix.name == 'Linux fsanitize'
- name: Build
run: nix-shell --run ./script/ci.sh
if: matrix.os != 'windows-latest'
- name: Build
run: msys2do ./script/ci.sh
if: matrix.os == 'windows-latest'
- name: Test
run: nix-shell --run "cd build/stage0.5; ctest -j4 --output-on-failure < /dev/null"
if: matrix.os != 'windows-latest'
- name: Test
run: msys2do cd build/stage0.5; ctest -j4 --output-on-failure ^< /dev/null
shell: cmd
if: matrix.os == 'windows-latest'
- name: Build Stage 2
run: nix-shell --run "cd build; make -j4 stage2"
if: matrix.build-stage2 || matrix.check-stage3
- name: Check Stage 3
run: nix-shell --run "cd build; make -j4 check-stage3"
if: matrix.check-stage3
- name: Test Speedcenter Benchmarks
run: PATH=$(realpath build/stage0.5/bin):$PATH nix-shell --run 'cd tests/bench; temci exec --config speedcenter.yaml --runs 1'
if: matrix.test-speedcenter
- name: CCache stats
run: nix-shell --run "ccache -s"
if: matrix.os != 'windows-latest'
- name: CCache stats
run: msys2do ccache -s
if: matrix.os == 'windows-latest'