forked from oxc-project/oxc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: autofix formatting relates jobs (oxc-project#5383)
closes oxc-project#5382 Autofixes toml, rust and unused dependencies. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
23ae0fa
commit 29f8497
Showing
3 changed files
with
30 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci". | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**/*.rs' | ||
- '**/*.toml' | ||
- '.github/workflows/autofix.yml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: ${{ github.ref_name != 'main' }} | ||
|
||
jobs: | ||
autofix: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
restore-cache: false | ||
tools: taplo-cli,cargo-shear@1 | ||
components: rustfmt | ||
- run: cargo shear --fix | ||
- run: taplo fmt | ||
- run: cargo fmt --all | ||
- uses: autofix-ci/[email protected] | ||
with: | ||
fail-fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,41 +172,6 @@ jobs: | |
- if: steps.filter.outputs.src == 'true' | ||
run: cargo deny check | ||
|
||
unused-deps: | ||
name: Check Unused Dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
src: | ||
- '**/*.rs' | ||
- '**/Cargo.toml' | ||
- 'Cargo.lock' | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
restore-cache: false | ||
if: steps.filter.outputs.src == 'true' | ||
- uses: cargo-bins/[email protected] | ||
if: steps.filter.outputs.src == 'true' | ||
- run: cargo binstall --no-confirm cargo-shear@1 | ||
if: steps.filter.outputs.src == 'true' | ||
- run: cargo shear | ||
if: steps.filter.outputs.src == 'true' | ||
|
||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiki-e/checkout-action@v1 | ||
- uses: Boshen/setup-rust@main | ||
with: | ||
components: rustfmt | ||
restore-cache: false | ||
- run: cargo fmt --all -- --check | ||
|
||
lint: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ ast: | |
|
||
# Format all files | ||
fmt: | ||
cargo fmt | ||
cargo fmt --all | ||
taplo format | ||
|
||
# Run cargo check | ||
|