Repository navigation
58 lines (47 loc) · 1.61 KB
/
Copy pathunittests.yml
File metadata and controls
58 lines (47 loc) · 1.61 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
name: Unit test, lint and coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
rust:
name: Rust checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Check formatting
run: cargo fmt --manifest-path rust/Cargo.toml --check
- name: Check crate
run: cargo check --manifest-path rust/Cargo.toml --locked
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
- name: Ruff checks
run: uvx ruff check src tests && uvx ruff format --check src tests
- name: Install project and native extension from uv.lock
run: uv sync --locked --extra dev --python "${{ matrix.python-version }}"
- name: Test with pytest and coverage
env:
PYTHONUNBUFFERED: 1
run: uv run --no-sync python -m pytest --cov=src --cov-report=term-missing --cov-fail-under=90 tests