Skip to content

Build Test

Build Test #1926

Workflow file for this run

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", cmakeArgs: "-DSTORM_USE_CLN_EA=OFF -DSTORM_USE_CLN_RF=OFF -DSTORM_USE_SPOT_SYSTEM=ON -DSTORM_USE_SOPLEX=ON -DMSAT_ROOT=/opt/mathsat5 -DSTORM_COMPILE_WITH_ALL_SANITIZERS=ON -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON"}
- {name: "CLN exact; GMP rational functions; All dependencies", baseImg: "storm-dependencies:latest-debug", buildType: "Debug", cmakeArgs: "-DSTORM_USE_CLN_EA=ON -DSTORM_USE_CLN_RF=OFF -DSTORM_USE_SPOT_SYSTEM=ON -DSTORM_USE_SOPLEX=ON -DMSAT_ROOT=/opt/mathsat5 -DSTORM_COMPILE_WITH_ALL_SANITIZERS=ON -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON"}
- {name: "CLN exact; CLN rational functions; All dependencies", baseImg: "storm-dependencies:latest-debug", buildType: "Debug", cmakeArgs: "-DSTORM_USE_CLN_EA=ON -DSTORM_USE_CLN_RF=ON -DSTORM_USE_SPOT_SYSTEM=ON -DSTORM_USE_SOPLEX=ON -DMSAT_ROOT=/opt/mathsat5 -DSTORM_COMPILE_WITH_ALL_SANITIZERS=ON -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON"}
- {name: "GMP exact; CLN rational functions; No dependencies", baseImg: "storm-dependencies:latest-debug", buildType: "Debug", cmakeArgs: "-DSTORM_USE_CLN_EA=OFF -DSTORM_USE_CLN_RF=ON -DSTORM_USE_SPOT_SYSTEM=OFF -DSTORM_USE_SOPLEX=OFF -DMSAT_ROOT= -DSTORM_COMPILE_WITH_ALL_SANITIZERS=ON -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON"}
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 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.compilers.name }}, ${{ matrix.compilers.buildType }})
runs-on: ubuntu-latest
strategy:
matrix:
compilers:
- {name: "GCC", buildType: "Debug", cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON -DSTORM_USE_SPOT_SHIPPED=ON", packages: ""}
- {name: "Clang", buildType: "Debug", cmakeArgs: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON -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.compilers.buildType }}" --build-arg cmake_args="${{ matrix.compilers.cmakeArgs }}" --build-arg packages="${{ matrix.compilers.packages }}" --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.compilers.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.compilers.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"]
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 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.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", cmakeArgs: "-DSTORM_DEVELOPER=ON -DSTORM_PORTABLE=ON"}
- {name: "Release", dockerTag: "ci", baseImg: "storm-dependencies:latest", cmakeArgs: "-DSTORM_DEVELOPER=OFF -DSTORM_PORTABLE=ON"}
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 cmake_args="${{ matrix.buildType.cmakeArgs }}" --build-arg no_threads=${NR_JOBS}
- 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