-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2.26 KB
/
test-coverage.yml
File metadata and controls
73 lines (60 loc) · 2.26 KB
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
# Runs unit tests, functional tests and publishes coverage.
name: Tests with coverage
on:
workflow_dispatch:
inputs:
RUST_LOG:
description: "Log level"
required: false
default: "info"
type: string
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-test-coverage
cancel-in-progress: true
permissions:
contents: read
jobs:
unit-tests:
uses: ./.github/workflows/unit.yml
functional-tests:
uses: ./.github/workflows/functional.yml
publish-coverage:
name: Publish test coverage
runs-on: ubuntu-latest
if: always()
needs: [functional-tests, unit-tests]
timeout-minutes: 10
steps:
# NOTE: codecov action needs source files in the same path as in the lcov.info
# ensure the source location is same in unit test, functional test and this job
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
with:
persist-credentials: false
- name: Download functional test coverage
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: functional-lcov
- name: Download unit test coverage
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: unit-lcov
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Merge test coverage
run: |
lcov --add-tracefile ./lcov.unit.info \
--add-tracefile ./lcov.functional.info \
--output-file ./lcov.info
- name: Publish Test Coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
with:
files: lcov.info