-
Notifications
You must be signed in to change notification settings - Fork 102
46 lines (39 loc) · 1.69 KB
/
code-coverage.yml
File metadata and controls
46 lines (39 loc) · 1.69 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
name: Code Coverage
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
analyze:
runs-on: ubuntu-24.04
env:
CARGO_INCREMENTAL: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
PR_TITLE: ${{github.event.pull_request.title}}
PR_BASE_COMMIT: ${{github.event.pull_request.base.sha}}
GIT_AUTHOR_NAME: ${{github.event.pull_request.user.login}}
GIT_AUTHOR_EMAIL: ${{github.event.pull_request.user.id}}+${{github.event.pull_request.user.login}}@users.noreply.github.com
GIT_COMMITTER_NAME: ${{github.event.pull_request.user.login}}
GIT_COMMITTER_EMAIL: ${{github.event.pull_request.user.id}}+${{github.event.pull_request.user.login}}@users.noreply.github.com
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure actions-cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
- name: Run code coverage analysis (look at workflow "Summary" tab for results)
run: |
cargo install rustfilt
./ci.sh build_fw test > coverage.txt || true
sed -i -n '/coverage files found$/,$p' coverage.txt
echo '# Code Coverage' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat coverage.txt | rustfilt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY