| 1 |
--- |
| 2 |
name: Testing |
| 3 |
|
| 4 |
# yamllint disable-line rule:truthy |
| 5 |
on: |
| 6 |
push: |
| 7 |
branches: |
| 8 |
- main |
| 9 |
pull_request: |
| 10 |
workflow_dispatch: |
| 11 |
|
| 12 |
env: |
| 13 |
DEFAULT_PYTHON: "3.11" |
| 14 |
|
| 15 |
jobs: |
| 16 |
pytest: |
| 17 |
name: Python ${{ matrix.python }} |
| 18 |
runs-on: ubuntu-latest |
| 19 |
strategy: |
| 20 |
matrix: |
| 21 |
python: ["3.11", "3.12", "3.13", "3.14"] |
| 22 |
steps: |
| 23 |
- name: โคต๏ธ Check out code from GitHub |
| 24 |
uses: actions/[email protected] |
| 25 |
- name: ๐ Set up uv |
| 26 |
uses: astral-sh/[email protected] |
| 27 |
- name: ๐ Set up Python ${{ matrix.python }} |
| 28 |
id: python |
| 29 |
uses: actions/[email protected] |
| 30 |
with: |
| 31 |
python-version: ${{ matrix.python }} |
| 32 |
- name: ๐ Install dependencies |
| 33 |
run: uv sync |
| 34 |
- name: ๐ Run pytest |
| 35 |
run: uv run pytest --cov aiotankerkoenig tests |
| 36 |
- name: โฌ๏ธ Upload coverage artifact |
| 37 |
uses: actions/[email protected] |
| 38 |
with: |
| 39 |
name: coverage-${{ matrix.python }} |
| 40 |
path: .coverage |
| 41 |
include-hidden-files: true |
| 42 |
|
| 43 |
coverage: |
| 44 |
runs-on: ubuntu-latest |
| 45 |
needs: pytest |
| 46 |
steps: |
| 47 |
- name: โคต๏ธ Check out code from GitHub |
| 48 |
uses: actions/[email protected] |
| 49 |
with: |
| 50 |
fetch-depth: 0 |
| 51 |
- name: โฌ๏ธ Download coverage data |
| 52 |
uses: actions/[email protected] |
| 53 |
with: |
| 54 |
pattern: coverage-* |
| 55 |
- name: ๐ Set up uv |
| 56 |
uses: astral-sh/[email protected] |
| 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 |
- name: ๐ Install dependencies |
| 63 |
run: uv sync |
| 64 |
- name: ๐ Process coverage results |
| 65 |
run: | |
| 66 |
uv run coverage combine coverage*/.coverage* |
| 67 |
uv run coverage xml -i |
| 68 |
- name: ๐ Upload coverage report |
| 69 |
uses: codecov/codecov-action@v6 |