forked from conjure-cp/conjure-oxide
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (81 loc) · 3.22 KB
/
code-coverage-main.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: "Code and Documentation Coverage (main)"
on:
push:
branches:
- main # run for pushes to the main branch
workflow_dispatch:
env:
rust_release: nightly
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_VERSION: 2
jobs:
doc-coverage:
name: "Documentation Coverage"
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install rust ${{ env.rust_release }}
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
- name: Disable rust-lld (to fix linkme)
run: |
echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
echo RUSTDOCFLAGS=${RUSTDOCFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
if: env.rust_release == 'nightly'
- name: Install pandoc
uses: pandoc/actions/setup@v1
- name: Generate documentation coverage report
run: |
echo "# Documentation Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
./tools/ci/generate-doc-coverage-summary-md.bash >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Commit: [${{github.event.after}}](https://github.com/conjure-cp/conjure-oxide/commit/${{github.event.after}})" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
./tools/ci/generate-doc-coverage-report-md.bash >> $GITHUB_STEP_SUMMARY
- name: Generate summary
run: |
./tools/ci/generate-doc-coverage-summary-md.bash > main-doc-coverage-summary.txt
- name: Upload summary as artifact (for later use)
uses: actions/upload-artifact@v4
with:
name: main-doc-coverage-summary
path: main-doc-coverage-summary.txt
overwrite: true
coverage:
name: "Generate Code Coverage Reports"
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install rust ${{ env.rust_release }}
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
- name: Disable rust-lld (to fix linkme)
run: |
echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
echo RUSTDOCFLAGS=${RUSTDOCFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
- uses: ./.github/actions/install-conjure
with:
os_arch: linux
version: 2.5.1
- name: Generate code coverage reports
run: |
./tools/coverage.sh
- run: |
mkdir -p deploy/
cp -r target/debug/coverage/* deploy/ # html
cp target/debug/lcov.info deploy/ # used for diffing code coverage in PR comments
- name: Copy coverage report to /main.
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./deploy
target-folder: "coverage/main"
branch: gh-pages
commit-message: "Actions: Update code coverage for main "