Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
rustflags = ["--cfg", "tokio_unstable"] # also update .github/workflows/ci.yml
rustflags = ["--cfg", "tokio_unstable", "-D", "warnings"]

[unstable]
bindeps = true
Expand Down
38 changes: 24 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,29 @@ jobs:
code:
- '!**/*.md'

clippy:
needs: detect-changes
if: needs.detect-changes.outputs.code-changed == 'true'
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
save-cache: ${{ github.ref_name == 'main' }}
cache-key: clippy
components: clippy

- run: rustup target add x86_64-unknown-linux-musl
- run: pip install cargo-zigbuild

# --locked: verify Cargo.lock is up to date (replaces the removed `cargo check --locked`)
- run: cargo clippy --locked --all-targets --all-features -- -D warnings

test:
needs: detect-changes
if: needs.detect-changes.outputs.code-changed == 'true'
Expand Down Expand Up @@ -75,7 +98,6 @@ jobs:
with:
save-cache: ${{ github.ref_name == 'main' }}
cache-key: test
components: clippy

- run: rustup target add ${{ matrix.target }}

Expand All @@ -85,15 +107,6 @@ jobs:
- run: pip install cargo-zigbuild
if: ${{ matrix.os == 'ubuntu-latest' }}

- run: cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
env:
RUSTFLAGS: '-D warnings --cfg tokio_unstable' # also update .cargo/config.toml

- name: Clippy
id: clippy
continue-on-error: true
run: cargo clippy --all-targets --all-features -- -D warnings

# For x86_64-apple-darwin on arm64 runner, install x64 node so fspy preload dylib
# (compiled for x86_64) can be injected into node processes running under Rosetta.
# oxc-project/setup-node doesn't support the architecture input, so use
Expand All @@ -120,10 +133,6 @@ jobs:
- run: cargo-zigbuild test --target x86_64-unknown-linux-gnu.2.17
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Check clippy result
if: ${{ steps.clippy.outcome == 'failure' }}
run: exit 1

fmt:
name: Format and Check Deps
runs-on: ubuntu-latest
Expand Down Expand Up @@ -157,6 +166,7 @@ jobs:
runs-on: ubuntu-latest
if: always()
needs:
- clippy
- test
- fmt
steps:
Expand Down
Loading