-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (36 loc) · 1.2 KB
/
test.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
name: Test
on: [pull_request]
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install packages to support building lxml from source
run: sudo apt-get install python3.12-dev libxml2-dev libxslt-dev
- uses: actions/cache@v4
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install \
-r requirements/base.txt \
-r requirements/test.txt
- name: Check formatting
run: black . --check
- name: Check for missing migrations
run: ./manage.py makemigrations --check
- name: Check that all migrations have been applied to the sample database
run: ./manage.py migrate --check
- name: The test fixture should be kept in sync with the sample database
run: ./manage.py dumpdata --indent=4 crawler | diff crawler/fixtures/sample.json -
- name: Run Python tests
run: pytest