-
-
Notifications
You must be signed in to change notification settings - Fork 672
95 lines (78 loc) · 2.75 KB
/
ci.yml
File metadata and controls
95 lines (78 loc) · 2.75 KB
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
name: CI
on: [push, pull_request, workflow_dispatch]
permissions: {}
jobs:
migrations:
if: github.event_name != 'push' || github.event.repository.fork == true || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pythonorg
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Cache pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install dependencies
run: pip install --group dev -e .
- name: Check for ungenerated migrations
run: python manage.py makemigrations --check --dry-run
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pythonorg
test:
if: github.event_name != 'push' || github.event.repository.fork == true || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pythonorg
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v6
- name: Install platform dependencies
run: |
sudo apt -y update
sudo apt -y install --no-install-recommends \
texlive-latex-base \
texlive-latex-recommended \
texlive-plain-generic \
lmodern
- name: Install pandoc
run: |
wget https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-amd64.deb
sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb
- uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Cache pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install dependencies
run: pip install --group dev -e .
- name: Run tests
run: python -Wd -m coverage run manage.py test -v2
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pythonorg
- name: Check coverage
run: coverage report -m --fail-under=75