Build Test #100
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| # run weekly | |
| - cron: '0 10 * * 4' | |
| # needed to trigger the workflow manually | |
| workflow_dispatch: | |
| pull_request: | |
| env: | |
| # GitHub runners currently have 4 cores | |
| NR_JOBS: "4" | |
| jobs: | |
| linux_tests: | |
| name: Linux tests (${{ matrix.config.name }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| config: | |
| - {name: "CI, intree, Debug", | |
| base_image: "movesrwth/storm:ci-debug", | |
| build_type: "Debug", | |
| never_fetch_storm: "ON" | |
| } | |
| - {name: "CI, intree, Release", | |
| base_image: "movesrwth/storm:ci", | |
| build_type: "Release", | |
| never_fetch_storm: "ON" | |
| } | |
| - {name: "Stable, intree, Debug", | |
| base_image: "movesrwth/storm:stable-debug", | |
| build_type: "Debug", | |
| never_fetch_storm: "ON" | |
| } | |
| - {name: "Stable, intree, Release", | |
| base_image: "movesrwth/storm:stable", | |
| build_type: "Release", | |
| never_fetch_storm: "ON" | |
| } | |
| - {name: "Debian 12, fetch, intree, Release", | |
| base_image: "movesrwth/storm-basesystem:debian-12", | |
| build_type: "Release", | |
| never_fetch_storm: "OFF" | |
| } | |
| - {name: "Ubuntu 24.04, fetch, intree, Release", | |
| base_image: "movesrwth/storm-basesystem:ubuntu-24.04", | |
| build_type: "Release", | |
| never_fetch_storm: "OFF" | |
| } | |
| steps: | |
| - name: Git clone | |
| uses: actions/checkout@v6 | |
| - name: Build project from Dockerfile | |
| run: | | |
| docker build -t movesrwth/storm-starter . \ | |
| --build-arg BASE_IMAGE=${{ matrix.config.base_image }} \ | |
| --build-arg build_type="${{ matrix.config.build_type }}" \ | |
| --build-arg never_fetch_storm="${{ matrix.config.never_fetch_storm }}" \ | |
| --build-arg no_threads=${NR_JOBS} | |
| - name: Run Docker | |
| run: docker run -d -it --name ci movesrwth/storm-starter | |
| - name: Run and check output of example commands | |
| run: | | |
| docker exec ci bash -c "/opt/storm-project-starter-cpp/build/bin/starter-project /opt/storm-project-starter-cpp/examples/die.pm /opt/storm-project-starter-cpp/examples/die.pctl | grep 'no'" | |
| docker exec ci bash -c "/opt/storm-project-starter-cpp/build/bin/starter-project /opt/storm-project-starter-cpp/examples/die.pm /opt/storm-project-starter-cpp/examples/die2.pctl | grep 'yes'" | |
| mac_tests: | |
| name: macOS Tests (${{ matrix.config.name }}) | |
| strategy: | |
| matrix: | |
| config: | |
| - {name: "XCode Latest, Intel, fetch, intree, Release", | |
| distro: "macos-15-intel", | |
| xcode: "latest-stable", | |
| build_type: "Release", | |
| never_fetch_storm: "OFF" | |
| } | |
| - {name: "XCode 15.4, ARM, fetch, intree, Release", | |
| distro: "macos-14", | |
| xcode: "15.4", | |
| build_type: "Release", | |
| never_fetch_storm: "OFF" | |
| } | |
| - {name: "XCode Latest, ARM, fetch, intree, Debug", | |
| distro: "macos-15", | |
| xcode: "latest-stable", | |
| build_type: "Debug", | |
| never_fetch_storm: "OFF" | |
| } | |
| - {name: "XCode Latest, ARM, fetch, intree, Release", | |
| distro: "macos-15", | |
| xcode: "latest-stable", | |
| build_type: "Release", | |
| never_fetch_storm: "OFF" | |
| } | |
| runs-on: ${{ matrix.config.distro }} | |
| steps: | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: ${{ matrix.config.xcode }} | |
| - name: Git clone | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| # cmake and gmp are already installed | |
| run: | | |
| brew update | |
| brew install automake boost cln ginac glpk hwloc xerces-c z3 | |
| - name: Configure starter-project | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake -DCMAKE_BUILD_TYPE="${{ matrix.config.build_type }}" -DNEVER_FETCH_STORM="${{ matrix.config.never_fetch_storm }}" .. | |
| - name: Build starter-project | |
| working-directory: ./build | |
| run: make -j ${NR_JOBS} | |
| - name: Run and check output of example commands | |
| run: | | |
| /bin/bash -c "./build/bin/starter-project examples/die.pm examples/die.pctl | grep 'no'" | |
| /bin/bash -c "./build/bin/starter-project examples/die.pm examples/die2.pctl | grep 'yes'" | |
| notify: | |
| name: Email notification | |
| runs-on: ubuntu-latest | |
| needs: [linux_tests, mac_tests] | |
| # Only run in main repo and even if previous step failed | |
| if: github.repository_owner == 'stormchecker' && always() | |
| steps: | |
| - uses: technote-space/workflow-conclusion-action@v3 | |
| - uses: dawidd6/action-send-mail@v9 | |
| 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 |