-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (84 loc) · 2.76 KB
/
run-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
88
89
90
91
92
93
94
95
96
97
name: Run unit tests
on: [push, pull_request]
jobs:
run_tests:
name: Run unit tests with python ${{matrix.python-version}} - ${{ matrix.desc }}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- python-version: "3.9"
test_number: 0
engine: no
translator: yes
desc: "no engine"
- python-version: "3.9"
test_number: 1
desc: "no translator"
engine: yes
translator: no
- python-version: "3.10"
test_number: 2
desc: "full package v3.10"
engine: yes
translator: yes
- python-version: "3.11"
test_number: 3
desc: "full package v3.11"
engine: yes
translator: yes
- python-version: "3.12"
test_number: 4
desc: "full package v3.12"
engine: yes
translator: yes
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
pip install -U coveralls pytest pytest-cov
pip install -U setuptools pip wheel dask
- name: Install daliuge-common
run: pip install -e daliuge-common/
- name: Install daliuge-translator
if: ${{ matrix.translator == 'yes' }}
run: pip install -e "daliuge-translator/[test]"
- name: Install daliuge-engine
if: ${{ matrix.engine == 'yes' }}
run: pip install -e "daliuge-engine/[test]"
- name: Run daliuge-translator tests
if: ${{ matrix.translator == 'yes' }}
run: |
COVFILES=" daliuge-translator/.coverage"
echo "COVFILES=$COVFILES" >> $GITHUB_ENV
cd daliuge-translator
pip install -r test-requirements.txt
py.test --cov --show-capture=no
- name: Run daliuge-engine tests
if: ${{ matrix.engine == 'yes' }}
run: |
COVFILES="$COVFILES daliuge-engine/.coverage"
echo "COVFILES=$COVFILES" >> $GITHUB_ENV
cd daliuge-engine
py.test --cov --show-capture=no
- name: Combine coverage
run: coverage combine $COVFILES
- name: Update to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test_number }}
COVERALLS_PARALLEL: true
run: coveralls --service=github
finish:
needs: run_tests
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true