-
Notifications
You must be signed in to change notification settings - Fork 1.6k
70 lines (58 loc) · 1.64 KB
/
linux-ci-rust.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
name: Linux CI Rust
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
permissions:
contents: read
checks: write
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
tools/install-sys-dependencies-linux
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: |
rust
- name: Install Rust dependencies
run: |
tools/install-rust-dependencies dev
- name: Check code formatting
run: |
cargo fmt --check
working-directory: rust
- name: Check Clippy warnings
run: |
cargo clippy -- -D warnings
working-directory: rust
- name: Run tests
run: |
cargo llvm-cov nextest --profile ci --no-fail-fast --lcov --output-path coverage.info
working-directory: rust
- name: Rust Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Rust Tests
path: |
rust/target/nextest/ci/junit.xml
reporter: java-junit
- name: Gather and check Rust code coverage
run: |
tools/check-coverage rust/coverage.stats rust/coverage.info