-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (80 loc) · 2.34 KB
/
ci.yml
File metadata and controls
83 lines (80 loc) · 2.34 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
name: Continuous Integration
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
env:
POSTGRES_PORT: 5432
POSTGRES_DB: testdb
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
enable-cache: true
- name: Run linters
run: uvx --with pyyaml nox -vs lint
test:
needs: linter
timeout-minutes: 10
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:15
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: ${{ env.POSTGRES_DB }}
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11", "3.12", "3.13"]
django-version: ["4.2", "5.0", "5.1", "5.2"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Wait for DB to be ready
run: |
until pg_isready -h localhost -p 5432; do
echo "Waiting for postgres..."
sleep 1
done
timeout-minutes: 1
- name: Run unit tests
env:
UV_NO_MANAGED_PYTHON: "1"
UV_PYTHON_DOWNLOADS: "never"
APPLE_BUNDLE_ID: ${{ vars.APPLE_BUNDLE_ID }}
APPLE_SHARED_SECRET: ${{ vars.APPLE_SHARED_SECRET }}
GOOGLE_PLAY_PACKAGE_NAME: ${{ vars.GOOGLE_PLAY_PACKAGE_NAME }}
GOOGLE_PLAY_SERVICE_ACCOUNT: ${{ vars.GOOGLE_PLAY_SERVICE_ACCOUNT }}
PADDLE_VENDOR_ID: ${{ vars.PADDLE_VENDOR_ID }}
run: uvx --with pyyaml nox -vs "test(django='${{ matrix.django-version }}')"