1- on : [ workflow_dispatch, push ]
1+ on : [ push, pull_request ]
2+
3+ env :
4+ python-version : 3.13
5+
26jobs :
3- check :
7+ setup :
48 runs-on : ubuntu-latest
9+ outputs :
10+ cache-key : ${{ steps.cache-key.outputs.value }}
511 steps :
6- - uses : actions/checkout@v2
7- - uses : actions/setup-python@v2
12+ - uses : actions/checkout@v4
13+ - uses : actions/setup-python@v5
814 with :
9- python-version : ' 3.13'
15+ python-version : ${{ env.python-version }}
16+ - id : cache-key
17+ run : |
18+ HASH=$(sha256sum poetry.lock | cut -d ' ' -f1)
19+ echo "value=venv-${{ runner.os }}-python-${{ env.python-version }}-$HASH" >> $GITHUB_OUTPUT
1020 - uses : snok/install-poetry@v1
21+ with :
22+ virtualenvs-create : true
23+ virtualenvs-in-project : true
1124 - run : make install
12- - run : make lint
13- - run : make types
14- - run : make test
25+ - uses : actions/cache@v4
26+ with :
27+ path : .venv
28+ key : ${{ steps.cache-key.outputs.value }}
29+
30+ check :
31+ needs : setup
32+ runs-on : ubuntu-latest
33+ strategy :
34+ matrix :
35+ task : [ lint, types, test ]
36+ fail-fast : false
37+ steps :
38+ - uses : actions/checkout@v4
39+ - uses : actions/setup-python@v5
40+ with :
41+ python-version : ${{ env.python-version }}
42+ - uses : actions/cache@v4
43+ with :
44+ path : .venv
45+ key : ${{ needs.setup.outputs.cache-key }}
46+ fail-on-cache-miss : true
47+ - uses : snok/install-poetry@v1
48+ with :
49+ virtualenvs-create : true
50+ virtualenvs-in-project : true
51+
52+ - if : matrix.task == 'types'
53+ uses : actions/cache@v4
54+ with :
55+ path : .mypy_cache
56+ key : mypy-${{ runner.os }}-${{ env.python-version }}-${{ hashFiles('**/*.py') }}
57+ restore-keys : mypy-${{ runner.os }}-${{ env.python-version }}-
58+
59+ - run : make ${{ matrix.task }}
0 commit comments