-
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 2.08 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
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
coverage:
name: Evaluate code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
channel: nightly
components: clippy, llvm-tools-preview
bins: cargo-codspeed, cargo-sonar, cargo-llvm-cov
- name: Run Clippy
run: |
cargo clippy --message-format json > clippy-report.json
cargo sonar --clippy --clippy-path clippy-report.json
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path .coverage/lcov.info
- name: Coveralls
if: ${{ success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: .coverage/lcov.info
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.externalIssuesReportPaths=sonar-issues.json
-Dcommunity.rust.lcov.reportPaths=.coverage/lcov.info
- name: Build the benchmark target(s)
run: cargo codspeed build
- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}