-
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (48 loc) · 1.62 KB
/
Copy pathtest.yml
File metadata and controls
59 lines (48 loc) · 1.62 KB
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
name: Python tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
HATCH_VERSION: "1.17.0"
jobs:
test:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "${{matrix.python-version}}"
cache: "pip"
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
with:
version: "${{ env.HATCH_VERSION }}"
- name: Run type check
run: hatch run types:check
- name: Run formatter
run: hatch fmt --check
- name: Run pre-commit
run: hatch run pre-commit:run
env:
SKIP: nitpick,hatch-fmt,hatch-types
- name: Run tests
run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
name: "build-${{ matrix.python-version }}"
fail_ci_if_error: true
use_oidc: true