-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.58 KB
/
check.yaml
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
name: lint & test
on:
push:
branches: [dev]
pull_request:
branches: [dev, main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install rye
uses: eifinger/setup-rye@v1
- name: set python version
id: set-python
run: |
rye pin cpython@${{ matrix.python-version }}
cat .python-version
VERSION=$(cat .python-version)
echo "python_version=${VERSION}" >> $GITHUB_OUTPUT
- name: Load cached venv
id: cached-venv-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.set-python.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }}
- name: Install dependencies
if: steps.cached-venv-dependencies.outputs.cache-hit != 'true'
run: |
rye pin cpython@${{ steps.set-python.outputs.python_version }}
rye config --set-bool behavior.use-uv=false
rye sync --all-features
- name: Load cached pre-commit
id: cached-pre-commit-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: venv-${{ runner.os }}-${{ steps.cached-venv-dependencies.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }}
- name: Code checks
run: |
rye run pre-commit run --all-files --show-diff-on-failure
- name: Test with pytest
run: |
rye run pytest