-
Notifications
You must be signed in to change notification settings - Fork 3
99 lines (79 loc) · 2.28 KB
/
pipeline.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI pipeline
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
python-version: ["3.8", "3.9"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install wkhtmltopdf
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install xvfb libfontconfig wkhtmltopdf
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install wkhtmltopdf
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: python -m pip install --upgrade pip tox tox-gh-actions
- name: Write example configuration file
run: cp configuration.example.py configuration.py
- name: Run tests
run: tox
- name: Store Python version without dot
run: |
echo "PY_VER_NO_DOT=$(echo ${{ matrix.python-version }} | tr -d '.')" >> $GITHUB_OUTPUT
id: version
- name: Upload coverage artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: pytest-${{ steps.version.outputs.PY_VER_NO_DOT }}
path: reports/*
coverage:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: reports
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install tox
run: python -m pip install --upgrade pip tox
- name: Combine coverage results
run: tox run -e combine-test-reports
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install tox
run: python -m pip install --upgrade tox
- name: Run static checks
run: tox -e lint