Build Test #677
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 Test | |
# Builds and tests storm on various platforms | |
# also deploys images to Dockerhub | |
on: | |
schedule: | |
# run daily | |
- cron: '0 6 * * *' | |
# needed to trigger the workflow manually | |
workflow_dispatch: | |
pull_request: | |
env: | |
# GitHub runners currently have two cores | |
NR_JOBS: "2" | |
jobs: | |
# Perform in-depth tests with different configurations | |
indepthTests: | |
name: Indepth Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: | |
- {name: "GMP exact; GMP rational functions; All dependencies", | |
baseImg: "storm-dependencies:latest-debug", | |
buildType: "Debug", | |
Gurobi: "OFF", | |
Soplex: "ON", | |
Spot: "ON", | |
Developer: "ON", | |
ClnExact: "OFF", | |
ClnRatfunc: "OFF", | |
AllSanitizers: "ON", | |
cmakeArgs: "-DMSAT_ROOT=/opt/mathsat5" | |
} | |
- {name: "CLN exact; GMP rational functions; All dependencies", | |
baseImg: "storm-dependencies:latest-debug", | |
buildType: "Debug", | |
Gurobi: "OFF", | |
Soplex: "ON", | |
Spot: "ON", | |
Developer: "ON", | |
ClnExact: "ON", | |
ClnRatfunc: "OFF", | |
AllSanitizers: "ON", | |
cmakeArgs: "-DMSAT_ROOT=/opt/mathsat5" | |
} | |
- {name: "CLN exact; CLN rational functions; All dependencies", | |
baseImg: "storm-dependencies:latest-debug", | |
buildType: "Debug", | |
Gurobi: "OFF", | |
Soplex: "ON", | |
Spot: "ON", | |
Developer: "ON", | |
ClnExact: "ON", | |
ClnRatfunc: "ON", | |
AllSanitizers: "ON", | |
cmakeArgs: "-DMSAT_ROOT=/opt/mathsat5" | |
} | |
- {name: "GMP exact; CLN rational functions; No dependencies", | |
baseImg: "storm-dependencies:latest-debug", | |
buildType: "Debug", | |
Gurobi: "OFF", | |
Soplex: "OFF", | |
Spot: "OFF", | |
Developer: "ON", | |
ClnExact: "OFF", | |
ClnRatfunc: "ON", | |
AllSanitizers: "ON", | |
cmakeArgs: "-DMSAT_ROOT=" | |
} | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
- name: Build storm from Dockerfile | |
run: | | |
docker build -t movesrwth/storm:ci . \ | |
--build-arg BASE_IMG=movesrwth/${{ matrix.config.baseImg }} \ | |
--build-arg build_type="${{ matrix.config.buildType }}" \ | |
--build-arg gurobi_support="${{ matrix.config.Gurobi }}" \ | |
--build-arg soplex_support="${{ matrix.config.Soplex }}" \ | |
--build-arg spot_support="${{ matrix.config.Spot }}" \ | |
--build-arg developer="${{ matrix.config.Developer }}" \ | |
--build-arg cln_exact="${{ matrix.config.ClnExact }}" \ | |
--build-arg cln_ratfunc="${{ matrix.config.ClnRatfunc }}" \ | |
--build-arg all_sanitizers="${{ matrix.config.AllSanitizers }}" \ | |
--build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \ | |
--build-arg no_threads=${NR_JOBS} | |
- name: Run Docker | |
run: docker run -d -it --name ci movesrwth/storm:ci | |
# A bit hacky... but its usefulness has been proven in production | |
- name: Check release makeflags | |
if: matrix.config.buildType == 'Release' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)" | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)" | |
- name: Check debug makeflags | |
if: matrix.config.buildType == 'Debug' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)" | |
- name: Build tests | |
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}" | |
- name: Run tests | |
run: docker exec ci bash -c "cd /opt/storm/build; ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0 ctest test --output-on-failure" | |
compilerTests: | |
# Build and run with different compilers (GCC, Clang) | |
# Run on latest Archlinux version to get most recent compiler versions | |
name: Compiler Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: | |
- {name: "GCC", | |
buildType: "Debug", | |
Gurobi: "OFF", | |
Soplex: "OFF", | |
Spot: "OFF", | |
Developer: "ON", | |
cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_USE_SPOT_SHIPPED=ON", | |
packages: "" | |
} | |
- {name: "Clang", | |
buildType: "Debug", | |
Gurobi: "OFF", | |
Soplex: "OFF", | |
Spot: "OFF", | |
Developer: "ON", | |
cmakeArgs: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTORM_USE_SPOT_SHIPPED=ON", | |
packages: "clang" | |
} | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
- name: Replace Dockerfile | |
run: cp .github/workflows/Dockerfile.archlinux Dockerfile | |
- name: Build storm from Dockerfile | |
run: | | |
docker build -t movesrwth/storm:ci . \ | |
--build-arg build_type="${{ matrix.config.buildType }}" \ | |
--build-arg gurobi_support="${{ matrix.config.Gurobi }}" \ | |
--build-arg soplex_support="${{ matrix.config.Soplex }}" \ | |
--build-arg spot_support="${{ matrix.config.Spot }}" \ | |
--build-arg developer="${{ matrix.config.Developer }}" \ | |
--build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \ | |
--build-arg packages="${{ matrix.config.packages }}" \ | |
--build-arg no_threads=${NR_JOBS} | |
# Omitting arguments cln_exact, cln_ratfunc, all_sanitizers | |
- name: Run Docker | |
run: docker run -d -it --name ci movesrwth/storm:ci | |
# A bit hacky... but its usefulness has been proven in production | |
- name: Check release makeflags | |
if: matrix.config.buildType == 'Release' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)" | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)" | |
- name: Check debug makeflags | |
if: matrix.config.buildType == 'Debug' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)" | |
- name: Build tests | |
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}" | |
- name: Run tests | |
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" | |
distroTests: | |
name: Distro Tests (${{ matrix.distro }}, ${{ matrix.buildType }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
distro: ["debian-11", "debian-12", "ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"] | |
buildType: ["Release"] | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
- name: Build storm from Dockerfile | |
run: | | |
docker build -t movesrwth/storm:ci . \ | |
--build-arg BASE_IMG=movesrwth/storm-basesystem:${{ matrix.distro }} \ | |
--build-arg build_type="${{ matrix.buildType }}" \ | |
--build-arg gurobi_support="OFF" \ | |
--build-arg soplex_support="OFF" \ | |
--build-arg spot_support="OFF" \ | |
--build-arg no_threads=${NR_JOBS} | |
# Omitting arguments developer, cln_exact, cln_ratfunc, all_sanitizers, cmake_args | |
- name: Run Docker | |
run: docker run -d -it --name ci movesrwth/storm:ci | |
# A bit hacky... but its usefulness has been proven in production | |
- name: Check release makeflags | |
if: matrix.buildType == 'Release' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)" | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)" | |
- name: Check debug makeflags | |
if: matrix.buildType == 'Debug' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)" | |
- name: Build tests | |
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}" | |
- name: Run tests | |
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" | |
deploy: | |
name: Test and Deploy (${{ matrix.buildType.name }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
buildType: | |
- {name: "Debug", | |
dockerTag: "ci-debug", | |
baseImg: "storm-dependencies:latest-debug", | |
Gurobi: "OFF", | |
Developer: "ON" | |
} | |
- {name: "Release", | |
dockerTag: "ci", | |
baseImg: "storm-dependencies:latest", | |
Gurobi: "OFF", | |
Developer: "OFF" | |
} | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
- name: Git describe | |
id: ghd | |
uses: proudust/gh-describe@v2 | |
- name: Set static Storm version | |
run: echo "set(STORM_VERSION_COMMITS_AHEAD ${{ steps.ghd.outputs.distance }})" >> version.cmake | |
- name: Build storm from Dockerfile | |
run: | | |
docker build -t movesrwth/storm:${{ matrix.buildType.dockerTag }} . \ | |
--build-arg BASE_IMG=movesrwth/${{ matrix.buildType.baseImg }} \ | |
--build-arg build_type="${{ matrix.buildType.name }}" \ | |
--build-arg developer="${{ matrix.buildType.Developer }}" \ | |
--build-arg gurobi_support="${{ matrix.config.Gurobi }}" \ | |
--build-arg cmake_args="${{ matrix.buildType.cmakeArgs }}" \ | |
--build-arg no_threads=${NR_JOBS} | |
# Omitting arguments gurobi_support, soplex_support, spot_support, cln_exact, cln_ratfunc, all_sanitizers | |
- name: Run Docker | |
run: docker run -d -it --name ci movesrwth/storm:${{ matrix.buildType.dockerTag }} | |
# A bit hacky... but its usefulness has been proven in production | |
- name: Check release makeflags | |
if: matrix.buildType.name == 'Release' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)" | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)" | |
- name: Check debug makeflags | |
if: matrix.buildType.name == 'Debug' | |
run: | | |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)" | |
- name: Build tests | |
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}" | |
- name: Run tests | |
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" | |
- name: Login into docker | |
# Only login if using master on original repo (and not for pull requests or forks) | |
if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' | |
run: echo "${{ secrets.STORM_CI_DOCKER_PASSWORD }}" | docker login -u "${{ secrets.STORM_CI_DOCKER_USERNAME }}" --password-stdin | |
- name: Deploy storm | |
# Only deploy if using master on original repo (and not for pull requests or forks) | |
if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' | |
run: | | |
docker commit ci movesrwth/storm:${{ matrix.buildType.dockerTag }} | |
docker push movesrwth/storm:${{ matrix.buildType.dockerTag }} | |
notify: | |
name: Email notification | |
runs-on: ubuntu-latest | |
needs: [indepthTests, compilerTests, distroTests, deploy] | |
# Only run in main repo and even if previous step failed | |
if: github.repository_owner == 'moves-rwth' && always() | |
steps: | |
- uses: technote-space/workflow-conclusion-action@v3 | |
- uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: ${{ secrets.STORM_CI_MAIL_SERVER }} | |
server_port: 587 | |
username: ${{ secrets.STORM_CI_MAIL_USERNAME }} | |
password: ${{ secrets.STORM_CI_MAIL_PASSWORD }} | |
subject: "[You broke it] CI run failed for ${{ github.repository }}" | |
body: | |
"CI job of ${{ github.repository }} has failed for commit ${{ github.sha }}.\n\ | |
The error type is: ${{ env.WORKFLOW_CONCLUSION }}.\n\n\ | |
For more information, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
to: ${{ secrets.STORM_CI_MAIL_RECIPIENTS }} | |
from: Github Actions <you-broke-it@stormchecker.org> | |
if: env.WORKFLOW_CONCLUSION != 'success' # notify only if failure |