Build Test #7
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 | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
# run weekly | |
- cron: '0 10 * * 4' | |
# needed to trigger the workflow manually | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build: | |
name: Build and Run (${{ matrix.buildType.name }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
buildType: | |
- {name: "Debug", | |
baseImg: "storm:ci-debug", | |
} | |
- {name: "Release", | |
baseImg: "storm:ci", | |
} | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
- name: Build project from Dockerfile | |
run: | | |
docker build -t movesrwth/storm-starter . \ | |
--build-arg BASE_IMG=movesrwth/${{ matrix.buildType.baseImg }} \ | |
--build-arg build_type="${{ matrix.buildType.name }}" | |
- 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/storm-project-starter /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/storm-project-starter /opt/storm-project-starter-cpp/examples/die.pm /opt/storm-project-starter-cpp/examples/die2.pctl | grep 'yes'" | |
notify: | |
name: Email notification | |
runs-on: ubuntu-latest | |
needs: [build] | |
# 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 <[email protected]> | |
if: env.WORKFLOW_CONCLUSION != 'success' # notify only if failure |