-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (81 loc) · 2.09 KB
/
python.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Python
on:
push:
branches: [main]
pull_request:
types: [assigned, opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.13
- name: Cache tests
uses: actions/cache@v3
with:
path: |
Makefile
openfisca_aotearoa/tests
poetry.lock
tox.ini
key: tests-${{ github.sha }}
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: dist
key: build-${{ hashFiles('poetry.lock') }}-${{ github.sha }}
- name: Build package
if: steps.cache-build.outputs.cache-hit != 'true'
run: poetry build
lint:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.13
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: make install
- name: Lint files
run: make lint
test:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Install Tox
run: pipx install tox
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.13
- name: Restore tests
uses: actions/cache@v3
with:
path: |
Makefile
openfisca_aotearoa/tests
poetry.lock
tox.ini
key: tests-${{ github.sha }}
- name: Restore build
uses: actions/cache@v3
with:
path: dist
key: build-${{ hashFiles('poetry.lock') }}-${{ github.sha }}
- name: Run the test suite
run: tox