fix: resolve CI rustfmt not installed error
This commit is contained in:
@@ -11,50 +11,20 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Set up Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: default
|
||||
profile: minimal
|
||||
components: rustfmt, clippy
|
||||
- name: Check Rust formatting
|
||||
run: cargo fmt --check --all
|
||||
- name: Run Rust clippy
|
||||
run: cargo clippy --all -- -D warnings
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -- -D warnings
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: default
|
||||
profile: minimal
|
||||
components: rustfmt
|
||||
- name: Build gitignore-gen
|
||||
run: cargo build --all
|
||||
- name: Run tests
|
||||
run: cargo test --all
|
||||
|
||||
release:
|
||||
needs: [lint, test]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: default
|
||||
- name: Build release
|
||||
run: cargo build --release --tarball
|
||||
- name: Create Release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |
|
||||
target/release/gitignore-gen
|
||||
- run: cargo test --all
|
||||
|
||||
Reference in New Issue
Block a user