-
-
Notifications
You must be signed in to change notification settings - Fork 582
72 lines (62 loc) · 1.93 KB
/
ci.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
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
name: Continuous Integration
on:
push:
branches: [ master, ]
paths:
- '**.py'
- 'requirements.txt'
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, ]
paths:
- '**.py'
- 'requirements.txt'
jobs:
ci-job:
runs-on: ubuntu-latest
strategy:
matrix:
#TODO: pypy3 has problems compiling lxml
python-version: [ '3.10', '3.11', '3.12' ]
name: CI job (python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install wheel coverage
pip install -r requirements_dev.txt
pip install -r requirements_prod.txt
pip install -e .
# Only run the tests with coverage for one version of python
- name: Test the application with coverage
if: matrix.python-version == 3.11
run: |
wger create-settings
coverage run --source='.' ./manage.py test
coverage lcov
- name: Test the application
if: matrix.python-version != 3.11
run: |
wger create-settings
python manage.py test
- name: Coveralls
if: matrix.python-version == 3.11
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov