-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (93 loc) · 3.08 KB
/
check.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
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Linting and Testing
on:
push:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
permissions:
pull-requests: write
id-token: write
pages: write
checks: write
contents: write
runs-on: ubuntu-24.04-8core-bakunin
steps:
- uses: actions/checkout@v4
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Rust toolchain
run: |
rustup set profile minimal
rustup show
- name: Ensure Rust formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: 3.20.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Clippy errors
uses: actions-rs/clippy-check@v1
env:
SKIP_WASM_BUILD: 1
with:
args: --color=always --tests -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
env:
RUST_BACKTRACE: 1
SKIP_WASM_BUILD: 1
run: cargo test
- uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Install cargo-llvm-cov
if: success() && steps.findPr.outputs.number
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-xtask
if: success() && steps.findPr.outputs.number
run: cargo install cargo-xtask
- name: Generate code coverage lcov
if: success() && steps.findPr.outputs.number
run: cargo xtask coverage
- name: Generate code coverage html
if: success() && steps.findPr.outputs.number
run: cargo xtask coverage --html
- name: Upload html coverage report
if: success() && steps.findPr.outputs.number
uses: actions/upload-pages-artifact@v3
with:
path: 'target/llvm-cov/html'
- name: Deploy to GitHub Pages
if: success() && steps.findPr.outputs.number
id: deployment
uses: actions/deploy-pages@v4
- name: Generate Coverage Summary Report
if: success() && steps.findPr.outputs.number
uses: irongut/[email protected]
with:
filename: target/cov.xml
badge: true
format: markdown
hide_branch_rate: false
# hide_complexity: true
indicators: true
output: both
- name: Append github pages link to report
if: success() && steps.findPr.outputs.number
run: chmod u+w code-coverage-results.md && echo "\n\n[Detailed coverage report]($GITHUB_PAGES_LINK)" &>> code-coverage-results.md
env:
GITHUB_PAGES_LINK: ${{ steps.deployment.outputs.page_url }}
- name: Add Coverage PR Comment
if: success() && steps.findPr.outputs.number
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.finder.outputs.pr }}
recreate: true
path: code-coverage-results.md