forked from conjure-cp/conjure-oxide
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 2.09 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
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:
coverage:
name: "Generate Code Coverage Reports"
# only do coverage for ready PRs
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- 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: matrix.rust_release == 'nightly'
- uses: ./.github/actions/install-conjure
with:
os_arch: linux
version: 2.5.1
- name: Generate coverage reports
run: |
./tools/coverage.sh
- name: Generate documentation coverage
run: |
RUSTDOCFLAGS='-Z unstable-options --show-coverage' cargo +nightly doc --workspace --no-deps > doc-coverage.txt
- name: Generate documentation coverage JSON
run: |
RUSTDOCFLAGS='-Z unstable-options --output-format json --show-coverage' cargo +nightly doc --workspace --no-deps > doc-coverage.json
- 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
cp doc-coverage.json deploy/
cp doc-coverage.txt deploy/
- 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 "