lean4-htt/.github/workflows/ci.yml

121 lines
3.9 KiB
YAML

name: CI
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
jobs:
Build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell || 'nix-shell --run "bash -euo pipefail {0}"' }}
strategy:
matrix:
include:
# portable release build: link most libraries statically and use channel with older glibc (2.27; LLVM 7)
- name: Linux release
os: ubuntu-latest
CMAKE_OPTIONS: -DSTATIC=ON
shell: nix-shell --arg pkgs "import (fetchTarball \"channel:nixos-19.03\") {{}}" --run "bash -euo pipefail {0}"
- 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: macOS
os: macos-latest
CMAKE_OPTIONS: -DSTATIC=ON
- name: Windows
os: windows-latest
shell: msys2 {0}
CMAKE_OPTIONS: -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTATIC=ON
# 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
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v9
if: matrix.os != 'windows-latest'
- name: Install MSYS2
uses: eine/setup-msys2@v0
with:
update: true
install: 'make python mingw-w64-x86_64-cmake mingw-w64-x86_64-clang mingw-w64-x86_64-ccache git diffutils'
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 nix-shell once for initial setup
true
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: |
mkdir build
cd build
cmake .. ${{ matrix.CMAKE_OPTIONS }}
make -j4
- name: Patch
run: patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 --remove-rpath build/stage0.5/bin/lean
if: matrix.name == 'Linux release'
- name: Pack
run: cd build/stage0.5; cpack
- uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.name }}
path: build/stage0.5/lean-*
- name: Test
run: |
cd build/stage0.5
ctest -j4 --output-on-failure < /dev/null
- name: Build Stage 2
run: |
cd build
make -j4 stage2
if: matrix.build-stage2 || matrix.check-stage3
- name: Check Stage 3
run: |
cd build
make -j4 check-stage3
if: matrix.check-stage3
- name: Test Speedcenter Benchmarks
run: |
export PATH=$PWD/build/stage0.5/bin:$PATH
cd tests/bench; temci exec --config speedcenter.yaml --runs 1
if: matrix.test-speedcenter
- name: Check rebootstrap
run: |
cd build
make update-stage0 && make -j4
if: matrix.name == 'Linux'
- name: CCache stats
run: ccache -s