fix: resolve CI rustfmt not installed error
This commit is contained in:
@@ -2,29 +2,45 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
profile: minimal
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
profile: minimal
|
||||
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