-
Notifications
You must be signed in to change notification settings - Fork 17
69 lines (61 loc) · 2.25 KB
/
_rust_lints.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
name: Rust lints
on:
workflow_call:
inputs:
isRust:
type: boolean
concurrency:
group: rust-lints-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_LOG: "error"
RUST_BACKTRACE: short
CARGO_INCREMENTAL: 0
jobs:
rustfmt:
if: (!cancelled() && inputs.isRust)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Install latest nightly
run: rustup toolchain install nightly --component rustfmt --allow-downgrade
- name: Check Rust formatting
run: cargo +nightly ci-fmt
cargo-sort:
if: (!cancelled() && inputs.isRust)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Check Cargo.toml format and sorting
run: |
pushd "scripts/cargo_sort"
./run.sh --skip-dprint
popd
- name: Check Cargo.toml diffs after formatting
run: |
if git status --porcelain | grep -q "Cargo.toml"; then
echo "Cargo.toml files not formatted and/or sorted properly! Please run the 'scripts/cargo_sort/run.sh' script."
git diff # Show the actual diffs
exit 1 # Fail the workflow
fi
clippy:
if: (!cancelled() && !failure() && inputs.isRust)
needs:
- rustfmt
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
# TODO(bradh): debug and re-enable this; the caching is breaking the clippy build
# Enable caching of the 'librocksdb-sys' crate by additionally caching the
# 'librocksdb-sys' src directory which is managed by cargo
# - uses: bmwill/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # v1.4.0 # Fork of 'Swatinem/rust-cache' which allows caching additional paths
# with:
# path: ~/.cargo/registry/src/**/librocksdb-sys-*
# See '.cargo/config' for list of enabled/disabled clippy lints
- name: Check Clippy Lints
run: cargo ci-clippy
- name: Check Clippy Lints with msim
run: |
git clean -fd
./scripts/simtest/clippy.sh