forked from equinor/ert
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.72 KB
/
coverage.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
name: Python coverage
on:
push:
branches:
- main
- 'version-**'
tags: "*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
python-test-coverage:
name: Python Coverage
timeout-minutes: 40
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-type: ['integration-tests', 'unit-tests', 'gui-tests']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: './.github/actions/install_dependencies'
if: matrix.test-type == 'gui-tests'
with:
os: ubuntu-latest
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install with dependencies
run: |
pip install .
pip install -r dev-requirements.txt
- name: Test GUI
if: matrix.test-type == 'gui-tests'
env:
DISPLAY: ':99.0'
run: |
ci/github/start_herbstluftwm.sh &
sleep 5
pytest tests/ --cov=ert --hypothesis-profile=ci -m "requires_window_manager" --cov-report=xml:cov.xml
- name: Test Integration
if: matrix.test-type == 'integration-tests'
run: |
pytest tests/ --cov=ert --hypothesis-profile=ci -m "integration_test" --cov-report=xml:cov.xml
- name: Test units
if: matrix.test-type == 'unit-tests'
run: |
pytest tests/ --cov=ert --hypothesis-profile=ci -m "not integration_test and not requires_window_manager" --cov-report=xml:cov.xml
- name: Upload python coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: tests/cov.xml