Repository navigation
66 lines (59 loc) · 1.71 KB
/
Copy pathpython.yml
File metadata and controls
66 lines (59 loc) · 1.71 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
name: Python
on:
workflow_call:
inputs:
coverage:
description: Upload the `coverage.xml` that pytest writes to Codecov
type: boolean
default: true
macos:
description: Also run the macOS leg
type: boolean
default: false
sparse-checkout:
description: Non-cone sparse-checkout patterns passed to actions/checkout
type: string
default: ''
submodules:
description: Check out submodules
type: boolean
default: false
secrets:
CACHIX_AUTH_TOKEN:
description: Upload token for the `hakula` Cachix cache
permissions:
contents: read
jobs:
python:
name: Python Check (${{ matrix.os }})
runs-on: ${{ matrix.os == 'macOS' && 'macos-latest' || 'ubuntu-latest' }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(inputs.macos && '["Linux", "macOS"]' || '["Linux"]') }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
sparse-checkout: ${{ inputs.sparse-checkout }}
sparse-checkout-cone-mode: ${{ inputs.sparse-checkout == '' }}
submodules: ${{ inputs.submodules }}
- name: Set up Nix
uses: $/.github/actions/setup-nix
with:
cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Run tests
run: |
nix develop \
--print-build-logs \
-c uv run --locked pytest
- name: Upload to Codecov
if: ${{ inputs.coverage }}
uses: codecov/codecov-action@v7
with:
files: coverage.xml
use_oidc: true