-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (43 loc) · 1.18 KB
/
python-app.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
name: Python application
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9.2
uses: actions/setup-python@v2
with:
python-version: 3.9.2
- name: Cache pre-commit
uses: actions/[email protected]
id: cache-precommit
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Cache Python files
uses: actions/cache@v2
with:
path: |
~/.virtualenvs
~/.cache/pip
~/.cache/pypoetry
key: poetry-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install Project Dependencies
run: |
cd backend
poetry install --no-interaction --no-root
if: steps.cache-poetry-envs.outputs.cache-hit != 'true'
- name: Run commit hooks
run: |
cd backend
touch .dev-reqs && touch .prod-reqs
make hooks