forked from oamg/convert2rhel
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.2 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
name: test_coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
coverage:
name: coverage-${{ matrix.el.distro }}${{ matrix.el.ver }}
strategy:
fail-fast: false
matrix:
el:
- distro: centos
ver: 7
- distro: centos
ver: 8
- distro: centos
ver: 9
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run pytest coverage
run: |
make tests${{ matrix.el.ver }} PYTEST_ARGS="--cov --cov-report xml --cov-report term" KEEP_TEST_CONTAINER=1 BUILD_IMAGES=0
podman cp pytest-container:/data/coverage.xml .
- name: Upload coverage to Codecov - First Attempt
id: UploadFirstAttempt
continue-on-error: true
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
env_vars: OS,PYTHON
flags: ${{ matrix.el.distro }}-linux-${{ matrix.el.ver }}
name: coverage-${{ matrix.el.distro }}
fail_ci_if_error: true
files: ./coverage.xml
verbose: true # optional (default = false)
- name: Wait before retrying
if: steps.UploadFirstAttempt.outcome == 'failure'
run: sleep 1m
- name: Upload coverage to Codecov - Second Attempt
id: UploadSecondAttempt
if: steps.UploadFirstAttempt.outcome == 'failure'
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
env_vars: OS,PYTHON
flags: ${{ matrix.el.distro }}-linux-${{ matrix.el.ver }}
name: coverage-${{ matrix.el.distro }}
fail_ci_if_error: true
files: ./coverage.xml
verbose: true # optional (default = false)