forked from ALU-Schumacher/AUDITOR
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (83 loc) · 2.34 KB
/
python-unit-tests.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
name: python-unit-tests
on:
pull_request:
push:
branches: [main]
jobs:
build-pyauditor:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pyauditor
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build pyauditor wheel from repo
run: |
pip install --upgrade pip
pip wheel .
- name: Upload pyauditor wheel
uses: actions/upload-artifact@v3
with:
name: pyauditor-wheel-${{ matrix.python-version }}
path: pyauditor/*.whl
retention-days: 7
unit-tests-apel-plugin:
runs-on: ubuntu-latest
needs: build-pyauditor
defaults:
run:
working-directory: ./plugins/apel
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download pyauditor wheel
uses: actions/download-artifact@v3
with:
name: pyauditor-wheel-${{ matrix.python-version }}
path: ./plugins/apel
- name: Install dependencies
run: |
pip install --upgrade pip
pip install *.whl
pip install -e .[tests]
- name: Run pytest
run: pytest
- name: Upload coverage as artifact
uses: actions/upload-artifact@v3
with:
name: lcov-${{ matrix.python-version }}.info
path: ./plugins/apel/lcov.info
retention-days: 7
upload-coverage:
runs-on: ubuntu-latest
needs: unit-tests-apel-plugin
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Download coverage artifact
uses: actions/download-artifact@v3
with:
name: lcov-${{ matrix.python-version }}.info
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true