Skip to content

Commit e5038ef

Browse files
committed
Add GitHub actions CI config
1 parent e4d224d commit e5038ef

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
lint:
9+
name: Lint soure code
10+
runs-on: ubuntu-latest
11+
container: python:3.13-bookworm
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Setup packages
15+
run: |
16+
pip install pretalx==2025.1.0
17+
pip install -e .[dev]
18+
- run: make lint
19+
20+
test_legacy:
21+
name: Test with known-good pretalx release and minimal supported Python
22+
runs-on: ubuntu-latest
23+
container: python:3.10-bookworm
24+
permissions:
25+
# Required for "EnricoMi/publish-unit-test-result-action"
26+
checks: write
27+
steps:
28+
- uses: actions/checkout@v4
29+
# REVISIT: Actually use pretalx release
30+
# Currently disabled because of unreleased migration to django-csp 4
31+
#- name: pip install pretalx==2025.1.0
32+
- name: Install pretalx from known-good Git commit (as workaround)
33+
working-directory: /tmp
34+
run: |
35+
apt-get --yes update
36+
apt-get --yes install git
37+
git clone https://github.com/pretalx/pretalx.git
38+
cd pretalx
39+
git checkout 22e2cb44a
40+
pip install .
41+
- run: pip install -e .[dev]
42+
- run: ./setup_vendored.py
43+
- name: Collect and compress assets
44+
run: |
45+
django-admin collectstatic --noinput
46+
django-admin compress
47+
env:
48+
DJANGO_SETTINGS_MODULE: pretalx.settings
49+
- run: pytest --junitxml=pytest-results.xml tests
50+
- name: Publish test results
51+
uses: EnricoMi/publish-unit-test-result-action@v2
52+
if: always()
53+
with:
54+
files: pytest-results.xml
55+
comment_mode: "off"
56+
- name: Archive test results
57+
uses: actions/upload-artifact@v4
58+
if: always()
59+
with:
60+
name: pytest-results-legacy
61+
path: pytest-results.xml
62+
if-no-files-found: error
63+
64+
test_head:
65+
name: Test with current pretalx HEAD and recent Python
66+
runs-on: ubuntu-latest
67+
container: python:3.13-bookworm
68+
permissions:
69+
checks: write
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Install pretalx from Git
73+
working-directory: /tmp
74+
run: |
75+
apt-get --yes update
76+
apt-get --yes install git
77+
git clone https://github.com/pretalx/pretalx.git
78+
pip install ./pretalx
79+
- run: pip install -e .[dev]
80+
- run: ./setup_vendored.py
81+
- name: Collect and compress assets
82+
run: |
83+
django-admin collectstatic --noinput
84+
django-admin compress
85+
env:
86+
DJANGO_SETTINGS_MODULE: pretalx.settings
87+
- run: pytest --junitxml=pytest-results.xml tests
88+
- name: Publish test results
89+
uses: EnricoMi/publish-unit-test-result-action@v2
90+
if: always()
91+
with:
92+
files: pytest-results.xml
93+
comment_mode: "off"
94+
- name: Archive test results
95+
uses: actions/upload-artifact@v4
96+
if: always()
97+
with:
98+
name: pytest-results-head
99+
path: pytest-results.xml
100+
if-no-files-found: error

0 commit comments

Comments
 (0)