-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.16 KB
/
pytest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 5 * * *"
# Cancel previous runs that have not completed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pytest:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
# These should match pyproject.toml
- "3.9"
- "3.10"
- "3.11"
- "3.12"
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-py${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install the Python package and dependencies
run: pip install --upgrade --upgrade-strategy=eager .[tests]
- name: Clone the transport-data/registry repo
run: coverage run -m transport_data store clone
- name: Run test suite using pytest
run: |
pytest transport_data \
--trace-config --color=yes -rA -vv --durations=20 \
--cov-append --cov-report=term --cov-report=xml \
--numprocesses auto
shell: bash
- name: Upload test coverage to Codecov.io
uses: codecov/codecov-action@v4
with: { token: "${{ secrets.CODECOV_TOKEN }}" }
pre-commit:
name: Code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: 3.x }
- run: python -m pip install pre-commit && python -m pip freeze --local
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Force recreation of pre-commit virtual environment for mypy
if: github.event_name == 'schedule' # Comment this line to run on a PR
run: pre-commit clean
- run: pre-commit run --all-files --color=always --show-diff-on-failure