Skip to content

Implement patient programs #268

Implement patient programs

Implement patient programs #268

Workflow file for this run

name: Python 🐍 package 📦 test
on:
pull_request:
branches:
- main
- develop
jobs:
get-python-versions:
runs-on: ubuntu-latest
outputs:
python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }}
steps:
- uses: snok/latest-python-versions@v1
id: get-python-versions-action
with:
min-version: 3.8
test:
permissions:
pull-requests: write
needs: [get-python-versions]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Load cached Poetry installation
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Specify Poetry Python version
run: poetry env use ${{ matrix.python-version }}
- name: Install dependencies
run: poetry install --with test --no-interaction
- name: Run tests
run: |
poetry run pytest \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov=welkin test/ | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
unique-id-for-comment: ${{ matrix.python-version }}