Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): lint debug fields in tracing events #664

Merged
merged 22 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-08-18
toolchain: nightly-2023-10-06
components: rustfmt
- name: run rustfmt
# note: for local development usually `cargo +nightly fmt` is sufficient;
# or `cargo +nightly-2023-08-18 fmt` for specifying the exactly release.
# or `cargo +nightly-2023-08-18 fmt` for specifying the exact release.
run: cargo fmt --all -- --check

toml:
Expand Down
48 changes: 42 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ jobs:
version: "24.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check that each crate compiles individually (circumventing workspace wide dependency resolution)
run: cargo hack check --all --all-features
run: |
: # exclude all lints because cargo-hack ignores default-members and operates on all workspace members
cargo hack check --workspace --all-features \
--exclude tracing_debug_field

lockfile:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -104,13 +107,13 @@ jobs:
version: "nightly-60ec00296f00754bc21ed68fd05ab6b54b50e024"
- name: Build tests
run: |
cargo test --no-run --release --workspace \
cargo test --no-run --release \
--all-features \
--all-targets \
--all-targets
- name: Run tests
timeout-minutes: 20
run: |
cargo test --release --workspace \
cargo test --release \
--all-features \
--all-targets \
-- --include-ignored
Expand Down Expand Up @@ -150,15 +153,48 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: run pedantic clippy on workspace crates
run: |
cargo clippy --workspace \
--all-targets --all-features \
cargo clippy --all-targets --all-features \
-- --warn clippy::pedantic --deny warnings
- name: run pedantic clippy on tools/protobuf-compiler
run: |
cargo clippy --manifest-path tools/protobuf-compiler/Cargo.toml \
--all-targets --all-features \
-- --warn clippy::pedantic --deny warnings

custom-lints:
runs-on: buildjet-8vcpu-ubuntu-2204
needs: run_checker
if: needs.run_checker.outputs.run_tests == 'true' && needs.run_checker.outputs.run_lint_rust == 'true'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
with:
# This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints
toolchain: nightly-2023-10-06
components: "clippy, llvm-tools-preview, rustc-dev"
- uses: Swatinem/rust-cache@v2.6.1
with:
cache-provider: "buildjet"
- name: install cargo-dylint and dylint-link
run: cargo install cargo-dylint@2.5.0 dylint-link@2.5.0 --locked
- uses: arduino/setup-protoc@v2
with:
version: "24.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: run clippy against custom lints
run: |
: # list all lint packages here to have clippy explicitly test them
cargo clippy --all-targets --all-features \
-p tracing_debug_field \
-- --warn clippy::pedantic --deny warnings
- name: run dylint clippy on workspace crates
env:
# set the dylint driver path to the target/ directory so that it's hopefully cached by rust-cache
DYLINT_DRIVER_PATH: ${{ github.workspace }}/target/dylint_drivers/
DYLINT_RUSTFLAGS: "-D warnings"
run: |
mkdir -p "$DYLINT_DRIVER_PATH"
cargo dylint --all --workspace

test:
if: ${{ always() && !cancelled() }}
Expand Down
Loading
Loading