66 pull_request :
77 branches : [ "main" ]
88
9+ permissions :
10+ contents : read
11+
912jobs :
10- build -and-test :
13+ validate -and-test :
1114 runs-on : ${{ matrix.os }}
1215 strategy :
1316 fail-fast : false
@@ -19,33 +22,34 @@ jobs:
1922 - name : Check out repository
2023 uses : actions/checkout@v4
2124
25+ - name : Install uv
26+ uses : astral-sh/setup-uv-action@v1
27+
2228 - name : Set up Python ${{ matrix.python-version }}
2329 uses : actions/setup-python@v5
2430 with :
2531 python-version : ${{ matrix.python-version }}
2632
27- - name : Install uv and dependencies
33+ - name : Cache uv dependencies
34+ uses : actions/cache@v4
35+ with :
36+ path : ~/.cache/uv
37+ key : ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
38+ restore-keys : |
39+ ${{ runner.os }}-uv-${{ matrix.python-version }}-
40+
41+ - name : Install dependencies
42+ run : uv pip install -e ".[dev]"
43+
44+ - name : Run linting and tests
2845 run : |
29- pip install uv
30- uv venv
31- uv pip install -e ".[dev]"
32-
33- - name : Run linting and formatting check
34- run : .venv/bin/python -m ruff check src/ tests/ && .venv/bin/python -m ruff format --check src/ tests/
35- if : runner.os != 'Windows'
36- - name : Run linting and formatting check (Windows)
37- run : .\.venv\Scripts\python.exe -m ruff check src/ tests/ ; .\.venv\Scripts\python.exe -m ruff format --check src/ tests/
38- if : runner.os == 'Windows'
39-
40- - name : Run tests and generate coverage report
41- run : .venv/bin/python -m coverage run -m unittest discover tests
42- if : runner.os != 'Windows'
43- - name : Run tests and generate coverage report (Windows)
44- run : .\.venv\Scripts\python.exe -m coverage run -m unittest discover tests
45- if : runner.os == 'Windows'
46+ make lint
47+ make coverage
48+ shell : bash
4649
4750 - name : Upload coverage reports to Codecov
48- uses : codecov/codecov-action@v4
51+ uses : codecov/codecov-action@v5
4952 with :
5053 token : ${{ secrets.CODECOV_TOKEN }}
51- fail_ci_if_error : true
54+ env :
55+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
0 commit comments