Skip to content

Fix CI

Fix CI #2

Workflow file for this run

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