Skip to content

Commit df93fe5

Browse files
committed
CI
1 parent 3327e7e commit df93fe5

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch: # Manually trigger a workflow run using the GitHub API, GitHub CLI, or the GitHub UI.
5+
push:
6+
pull_request:
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
contents: read # required for code coverage
12+
13+
jobs:
14+
15+
checks:
16+
name: checks
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
21+
os: [ubuntu-latest, macos-latest, windows-latest]
22+
23+
steps:
24+
- uses: actions/checkout@v5
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v6
28+
id: python-setup
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v7
34+
id: setup-uv
35+
with:
36+
# Install a specific version of uv.
37+
version: "0.9.10"
38+
enable-cache: true
39+
restore-cache: true
40+
save-cache: true
41+
prune-cache: true
42+
cache-dependency-glob: "uv.lock"
43+
44+
- name: Install the project
45+
run: uv sync --locked
46+
47+
- name: check uv cache is working
48+
if: steps.setup-uv.outputs.cache-hit == 'true'
49+
run: echo "uv cache was restored"
50+
51+
- name: isort
52+
run: uv run isort --check-only src tests scripts
53+
54+
- name: flake8
55+
run: |
56+
uv run flake8 --config .flake8 src tests scripts
57+
58+
- name: Cache mypy
59+
uses: actions/cache@v4
60+
with:
61+
path: ./.mypy_cache
62+
key: ${{ runner.os }}-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('uv.lock') }}
63+
64+
- name: mypy
65+
run: uv run mypy
66+
67+
- name: Code coverage testing
68+
run: |
69+
uv run coverage run
70+
71+
- name: Code coverage report
72+
run: |
73+
uv run coverage
74+

0 commit comments

Comments
 (0)