| 1 |
--- |
| 2 |
name: Testing |
| 3 |
|
| 4 |
# yamllint disable-line rule:truthy |
| 5 |
on: |
| 6 |
push: |
| 7 |
pull_request: |
| 8 |
workflow_dispatch: |
| 9 |
|
| 10 |
env: |
| 11 |
DEFAULT_PYTHON: "3.12" |
| 12 |
|
| 13 |
jobs: |
| 14 |
pytest: |
| 15 |
name: Python ${{ matrix.python }} |
| 16 |
runs-on: ubuntu-latest |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
python: ["3.12", "3.13", "3.14"] |
| 20 |
steps: |
| 21 |
- name: โคต๏ธ Check out code from GitHub |
| 22 |
uses: actions/[email protected] |
| 23 |
- name: ๐ Set up Poetry |
| 24 |
run: pipx install poetry |
| 25 |
- name: ๐ Set up Python ${{ matrix.python }} |
| 26 |
id: python |
| 27 |
uses: actions/[email protected] |
| 28 |
with: |
| 29 |
python-version: ${{ matrix.python }} |
| 30 |
cache: "poetry" |
| 31 |
- name: ๐ Install workflow dependencies |
| 32 |
run: | |
| 33 |
poetry config virtualenvs.create true |
| 34 |
poetry config virtualenvs.in-project true |
| 35 |
- name: ๐ Install dependencies |
| 36 |
run: poetry install --no-interaction |
| 37 |
- name: ๐ Run pytest |
| 38 |
run: poetry run pytest -v --cov-report xml:coverage.xml --cov src tests |
| 39 |
- name: โฌ๏ธ Upload coverage artifact |
| 40 |
uses: actions/[email protected] |
| 41 |
with: |
| 42 |
name: coverage-${{ matrix.python }} |
| 43 |
path: coverage.xml |
| 44 |
|
| 45 |
coverage: |
| 46 |
runs-on: ubuntu-latest |
| 47 |
needs: pytest |
| 48 |
steps: |
| 49 |
- name: โคต๏ธ Check out code from GitHub |
| 50 |
uses: actions/[email protected] |
| 51 |
with: |
| 52 |
fetch-depth: 0 |
| 53 |
- name: โฌ๏ธ Download coverage data |
| 54 |
uses: actions/[email protected] |
| 55 |
- name: ๐ Set up Poetry |
| 56 |
run: pipx install poetry |
| 57 |
- name: ๐ Set up Python ${{ env.DEFAULT_PYTHON }} |
| 58 |
id: python |
| 59 |
uses: actions/[email protected] |
| 60 |
with: |
| 61 |
python-version: ${{ env.DEFAULT_PYTHON }} |
| 62 |
cache: 'poetry' |
| 63 |
- name: ๐ Install workflow dependencies |
| 64 |
run: | |
| 65 |
poetry config virtualenvs.create true |
| 66 |
poetry config virtualenvs.in-project true |
| 67 |
- name: ๐ Install dependencies |
| 68 |
run: poetry install --no-interaction |
| 69 |
- name: ๐ Upload coverage report |
| 70 |
uses: codecov/[email protected] |
| 71 |
with: |
| 72 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 73 |
fail_ci_if_error: true |