fix: resolve CI rustfmt not installed error
This commit is contained in:
@@ -2,29 +2,45 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [ main, master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [ main, master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
- run: cargo fmt --check
|
|
||||||
- run: cargo clippy -- -D warnings
|
- name: Check rustfmt availability
|
||||||
|
working-directory: ./gitignore-gen
|
||||||
|
run: which rustfmt
|
||||||
|
|
||||||
|
- name: Run Rust linting
|
||||||
|
working-directory: ./gitignore-gen
|
||||||
|
run: |
|
||||||
|
cargo fmt --check
|
||||||
|
cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: lint
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- run: cargo test --all
|
|
||||||
|
- name: Build Rust project
|
||||||
|
working-directory: ./gitignore-gen
|
||||||
|
run: cargo build --all-targets
|
||||||
|
|
||||||
|
- name: Run Rust tests
|
||||||
|
working-directory: ./gitignore-gen
|
||||||
|
run: cargo test
|
||||||
|
|||||||
Reference in New Issue
Block a user