-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (48 loc) · 1.24 KB
/
lint-and-test.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
name: Lint and test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
lint-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.x"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: "set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
id: cache-venv
with:
path: ./.venv/
key: ${{ matrix.python-version }}-venv-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.python-version }}-venv
- name: 'create environment and install dependencies'
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
pip install .[all]
- name: 'update dependencies'
if: steps.cache-venv.outputs.cache-hit == 'true'
run: |
source .venv/bin/activate
pip install -U .[all]
- name: 'lint check & test'
run: |
source .venv/bin/activate
poe lint-check
poe test