-
Notifications
You must be signed in to change notification settings - Fork 108
80 lines (69 loc) · 2.03 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
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Python coverage
on:
push:
branches:
- main
- 'version-**'
tags: "*"
pull_request:
env:
UV_SYSTEM_PYTHON: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
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@v4
with:
fetch-depth: 0
submodules: true
lfs: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
run: pip install uv
- name: Install with dependencies
run: |
uv pip install ".[dev]"
- name: Test GUI
if: matrix.test-type == 'gui-tests'
run: |
pytest tests/ --cov=ert -m "requires_window_manager" --cov-report=xml:cov.xml -v
- name: Test Integration
if: matrix.test-type == 'integration-tests'
run: |
pytest tests/ -n logical --cov=ert -m "integration_test" --cov-report=xml:cov.xml
- name: Test units
if: matrix.test-type == 'unit-tests'
run: |
pytest tests/unit_tests -n logical --cov=ert -m "not integration_test and not requires_window_manager" --cov-report=xml:cov.xml --dist loadgroup
- name: Upload python coverage to Codecov
uses: codecov/codecov-action@v4
id: codecov1
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: cov.xml
flags: ${{ matrix.test-type }}
- name: codecov retry sleep
if: steps.codecov1.outcome == 'failure'
run: |
sleep 30
- name: Codecov retry
uses: codecov/codecov-action@v4
if: steps.codecov1.outcome == 'failure'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cov.xml
fail_ci_if_error: ${{ github.ref == 'refs/heads/main' }}