-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (92 loc) · 3.23 KB
/
pytest.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
name: Test and lint
on:
push:
merge_group:
schedule:
- cron: 0 13 * * 1
#pull_request:
workflow_dispatch:
repository_dispatch:
types: [trigger_checks]
jobs:
lint:
runs-on: macos-15
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
uv sync --frozen
source .venv/bin/activate
uv pip install --compile-bytecode --editable .
- name: Run Ruff
if: always()
uses: astral-sh/ruff-action@v3
with:
args: check --exit-non-zero-on-fix --no-fix
- name: Run Ruff Format
if: always()
uses: astral-sh/ruff-action@v3
with:
args: format --check
- name: Run mypy
if: always()
run: uv run --frozen -- mypy --install-types --non-interactive
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: |
source .venv/bin/activate
uv run --frozen -- pre-commit run --all-files --show-diff-on-failure --color=always
pytest:
timeout-minutes: 120
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15]
python-version: ['3.10', '3.11', '3.12', '3.13']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
name: pytest ${{ matrix.os }} python ${{ matrix.python-version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup uv
uses: astral-sh/setup-uv@v5
- name: Install pynonthermal
run: |
uv sync --frozen
uv pip install --compile-bytecode --editable .[dev]
- name: Test with pytest
run: uv run --frozen -- python3 -m pytest --cov=./ --cov-report=xml
- name: Report coverage
run: uv run --frozen -- python3 -m coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
# directory: ./coverage/reports/
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
verbose: true