-
Notifications
You must be signed in to change notification settings - Fork 44
90 lines (85 loc) · 2.64 KB
/
Copy pathrust.yml
File metadata and controls
90 lines (85 loc) · 2.64 KB
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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
id-token: write
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2.19.4
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v6
- name: Restore cached dependencies
uses: actions/cache/restore@v5
id: cache-restore
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Rustup version
run: rustup --version
- name: Install Rust components
run: rustup component add llvm-tools clippy rustfmt cargo
- name: Install ninja-build (Windows)
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v6
- name: Install NASM (Windows)
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install Go (macOS)
if: runner.os == 'macOS'
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install Cargo binaries
run: |
which cargo-llvm-cov || cargo install cargo-llvm-cov
which cargo-deny || cargo install cargo-deny
- name: Check licenses
run: cargo-deny check licenses
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose --all-features --no-fail-fast --workspace --exclude integration-tests
- name: Code Coverage
run: cargo llvm-cov --all-features --workspace --exclude integration-tests --codecov --output-path ./codecov.json
- name: Publish Code Coverage
uses: codecov/codecov-action@v6
with:
files: ./codecov.json
fail_ci_if_error: true
use_oidc: true
- name: Lint
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Cache dependencies
uses: actions/cache/save@v5
if: steps.cache-restore.outputs.cache-hit != 'true'
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}