Skip to content

Docker tests

Docker tests #424

Workflow file for this run

name: PyTest
on:
pull_request:
paths-ignore:
- "**.md"
jobs:
test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
strategy:
matrix:
container-python-version: ["docker://ckolbptb/mrpro_py311:latest", "docker://ckolbptb/mrpro_py312:latest"]
# runs within Docker container
container:
image: ${{ matrix.container-python-version }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: python -m pip install .[test]
- name: Install pytest-github-actions-annotate-failures plugin
run: pip install pytest-github-actions-annotate-failures
- name: Run PyTest
run: |
pytest -n 4 -m "not cuda" --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mrpro | tee pytest-coverage.txt
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/[email protected]
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
- name: Create the Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 48e334a10caf60e6708d7c712e56d241
filename: coverage.json
label: Coverage Report
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python
- name: Set pipeline status
run: |
if [[ ${{ steps.coverageComment.outputs.errors }} -ne 0 || ${{ steps.coverageComment.outputs.failures }} -ne 0 ]]; then
echo "Errors or failures detected, marking pipeline as failure."
exit 1
fi
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true