Test #10
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: Test | |
# Test starter project and notebooks | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
# run weekly | |
- cron: '0 10 * * 4' | |
# needed to trigger the workflow manually | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
test: | |
name: Test and Deploy (${{ matrix.config.stormpyImg }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: | |
- {stormpyImg: "stable-debug"} | |
- {stormpyImg: "stable"} | |
- {stormpyImg: "ci-debug"} | |
- {stormpyImg: "ci"} | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
- name: Build from Dockerfile | |
run: docker build -t movesrwth/stormpy-starter . --build-arg STORMPY_BASE=movesrwth/stormpy:${{ matrix.config.stormpyImg }} | |
- name: Run Docker | |
run: docker run -d -it --name ci -p 8888:8888 movesrwth/stormpy-starter | |
- name: Run and check output of example commands | |
run: | | |
docker exec ci bash -c "python stormpy_starter/check.py --model examples/die.pm --property examples/die.pctl | grep 'no'" | |
docker exec ci bash -c "python stormpy_starter/check.py --model examples/die.pm --property examples/die2.pctl | grep 'yes'" | |
- name: Run notebook | |
run: docker exec ci bash -c "pip install papermill && papermill stormpy_starter.ipynb" | |
notify: | |
name: Email notification | |
runs-on: ubuntu-latest | |
needs: [test] | |
# 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 |