-
Notifications
You must be signed in to change notification settings - Fork 21
68 lines (54 loc) · 1.85 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
name: Coverage
on:
schedule:
- cron: "0 3 * * 2" # 2 = Tuesday
workflow_dispatch:
concurrency:
group: coverage-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_KEY }}
- name: Rustup
run: rustup update
- name: Install dylint-link
run: cargo install --path ./dylint-link
- name: Install cargo-llvm-cov and rustfilt
run: |
cargo install cargo-llvm-cov
cargo install rustfilt
- name: Free up space on Ubuntu
run: |
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
# du -sh /usr/*/* 2>/dev/null | sort -h || true
- name: Preinstall toolchains
run: cargo run -p dylint_internal --bin preinstall-toolchains
- name: Coverage
run: |
for X in . driver utils/linting; do
pushd "$X"
TMP="$(mktemp)"
cargo llvm-cov --coverage-target-only --target x86_64-unknown-linux-gnu --workspace --failure-mode all --lcov --output-path "$TMP"
rustfilt -i "$TMP" -o lcov.info
popd
done
- name: Install lcov
run: sudo apt install lcov
- name: Generate html
run: find . -name lcov.info -print0 | xargs -0 genhtml --output-directory coverage
- name: Push to gh-pages branch
run: |
git add coverage
git config --global user.email "coverage@users.noreply.github.com"
git config --global user.name "coverage"
git commit -m Coverage
git push origin ${{ github.ref }}:gh-pages --force