-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (64 loc) · 1.87 KB
/
python-tests.yml
File metadata and controls
77 lines (64 loc) · 1.87 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Python tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
HATCH_VERSION: "1.16.5"
jobs:
test:
permissions:
contents: read
id-token: write
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
name: "Test on ${{matrix.os}} with Python ${{matrix.python-version}}"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "${{matrix.python-version}}"
cache: "pip"
- name: Install Hatch
uses: pypa/hatch@install
with:
version: "${{ env.HATCH_VERSION }}"
- run: hatch env find
- 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 --retries 2 --retry-delay 1
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
name: "build-${{ matrix.python-version }}"
fail_ci_if_error: true
use_oidc: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
with:
name: build-${{ matrix.python-version }}
fail_ci_if_error: true
use_oidc: true