Skip to content

Commit

Permalink
ci: autofix formatting relates jobs (oxc-project#5383)
Browse files Browse the repository at this point in the history
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
Boshen and autofix-ci[bot] authored Sep 1, 2024
1 parent 23ae0fa commit 29f8497
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 36 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/autofix.yml
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
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ast:

# Format all files
fmt:
cargo fmt
cargo fmt --all
taplo format

# Run cargo check
Expand Down

0 comments on commit 29f8497

Please sign in to comment.