-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (38 loc) · 1.08 KB
/
test_code.yaml
File metadata and controls
42 lines (38 loc) · 1.08 KB
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
# Hat tip: https://jacobian.org/til/github-actions-poetry/
name: test
on:
push:
branches: [main]
pull_request:
env:
SAM_API_KEY: not_a_real_key
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: cache poetry install
uses: actions/cache@v3
with:
path: ~/.local
key: pyenv-${{ matrix.python-version }}-poetry-1.6.1-0
- uses: snok/install-poetry@v1
with:
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
- run: pip install tox
- name: cache deps
id: cache-deps
uses: actions/cache@v3
with:
path: .tox
key: ${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.cfg') }}
- run: tox -e ${{ matrix.python-version }}