Skip to content

Commit

Permalink
ci: add autofix.ci (#68)
Browse files Browse the repository at this point in the history
closes #66
  • Loading branch information
Boshen authored Sep 2, 2024
1 parent 4f1d517 commit 734c7e5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci".

on:
pull_request:
types: [opened, synchronize]

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: true
tools: taplo-cli,cargo-shear@1
components: rustfmt

- uses: pnpm/[email protected]

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm

- run: pnpm install

- run: cargo codegen

- run: cargo shear --fix

- run: taplo fmt

- run: cargo fmt --all

- uses: autofix-ci/[email protected]
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ jobs:
- run: pnpm install
- run: cargo check --all-targets --all-features
- run: cargo test
- run: cargo codegen
- run: git diff --exit-code --quiet

lint:
name: Clippy
Expand All @@ -65,17 +63,6 @@ jobs:
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings

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

doc:
name: Doc
runs-on: ubuntu-latest
Expand All @@ -100,18 +87,6 @@ jobs:
rustup target add wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown --features wasm_bindgen
unused-deps:
name: Check Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
- uses: Boshen/setup-rust@main
with:
restore-cache: false
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall --no-confirm cargo-shear
- run: cargo shear

typos:
name: Spell Check
runs-on: ubuntu-latest
Expand Down

0 comments on commit 734c7e5

Please sign in to comment.