-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (42 loc) · 1.48 KB
/
tests.yaml
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
name: Tests
on: push
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4
- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox plugin
id: install-tox-gh-actions
run: |
pip install --disable-pip-version-check "tox-gh-actions>=3.2,<4"
- name: Run tests with Python ${{ matrix.python-version }}
id: pytest
if: ${{ matrix.python-version != '3.12' }}
run: |
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"
tox
- name: Run tests with Python ${{ matrix.python-version }} measuring coverage
id: pytest-coverage
if: ${{ matrix.python-version == '3.12' }}
run: |
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"
tox -- --cov="${{ steps.common.outputs.PACKAGE_NAME }}" --cov-report=xml
- name: Upload coverage to coveralls
id: coveralls
if: ${{ matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --upgrade coveralls
coveralls --service=github