-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (45 loc) · 1.5 KB
/
ci.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
name: Lint and test
on: [push, pull_request]
jobs:
lint-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
pip install --upgrade pip
pip install poetry
- name: "Cache poetry"
id: cache-poetry
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: "Cache pre-commit hooks"
id: cache-pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-python${{ matrix.python-version }}-pre-commit
- name: Install requirements
run: poetry install
- name: "Run the pre-commit hooks"
run: poetry run pre-commit run --all
env:
DJANGO_SETTINGS_MODULE: website.settings.development
- name: "Run django tests"
run: poetry run coverage run --source='website' website/manage.py test website
env:
DJANGO_SETTINGS_MODULE: website.settings.development
- name: "Check coverage"
run: poetry run coverage report
env:
DJANGO_SETTINGS_MODULE: website.settings.development