-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (67 loc) · 1.77 KB
/
Copy pathtests.yml
File metadata and controls
71 lines (67 loc) · 1.77 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
name: Tests
on:
push:
branches: [ main ]
paths-ignore:
- 'pretalx_vimeo/locale/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'pretalx_vimeo/locale/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
name: Tests (${{ matrix.database }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database: [sqlite, postgres]
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pretalx
options: >-
--health-cmd "pg_isready -U postgres -d pretalx"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version-file: ".github/workflows/python-version.txt"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- uses: extractions/setup-just@v4
- name: Install postgres driver
if: matrix.database == 'postgres'
run: uv sync --extra=dev && uv pip install psycopg2-binary
- name: Run tests
if: matrix.database == 'sqlite'
run: just test
- name: Run tests
if: matrix.database == 'postgres'
run: just test
env:
PRETALX_DB_TYPE: postgresql
PRETALX_DB_NAME: pretalx
PRETALX_DB_USER: postgres
PRETALX_DB_PASS: postgres
PRETALX_DB_HOST: localhost
tests:
name: Tests
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- if: needs.test.result != 'success'
run: exit 1