-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (65 loc) · 2.09 KB
/
ci-checks.yml
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
59
60
61
62
63
64
65
66
67
68
69
name: CI Checks
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract project's active Python version
id: python-version
shell: bash
run: echo "python-version=$(cat .tool-versions | grep python | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT"
working-directory: .
- uses: actions/setup-python@v4
with:
python-version: ${{ steps.python-version.outputs.python-version }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.7.1
- uses: actions/cache@v4
name: Configure Python poetry cache
with:
path: ./.venv
key: ${{ runner.os }}-${{ runner.arch }}-poetry-venv-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-poetry-venv-
- uses: arduino/setup-task@v2
- name: Install dependencies
shell: bash
run: task install
- name: Lint with ruff
shell: bash
run: task lint:ruff
- name: Type check with mypy
shell: bash
run: task lint:types
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.7.1
- uses: actions/cache@v4
name: Configure Python poetry cache
with:
path: ./.venv
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}-poetry-venv-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}-poetry-venv-
- uses: arduino/setup-task@v2
- name: Install dependencies
shell: bash
run: task install
- name: Run tests
shell: bash
run: task test