-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (48 loc) · 1.67 KB
/
Copy pathpython-package.yml
File metadata and controls
54 lines (48 loc) · 1.67 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches:
- '**'
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix: { python-version: ["3.10","3.11","3.12","3.13","3.14"] }
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0; prevent CWE-829
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Run unit tests
run: uv run nox --python ${{ matrix.python-version }} -s tests-${{ matrix.python-version }} # Run the specific test session
- name: Run documentation tests
run: uv run nox -s doctest
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
if: ${{ matrix.python-version == '3.12' }}
lint_and_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0; prevent CWE-829
with:
enable-cache: true
python-version: 3.12
- name: check lock file
run: uv lock --check
- name: Lint via nox
run: uv run nox -s lint_critical lint_style
if: always()
- name: Build docs
run: uv run nox -s docs
if: always()