47 lines
1016 B
YAML
47 lines
1016 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- 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
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
|
|
- name: Build Rust project
|
|
working-directory: ./gitignore-gen
|
|
run: cargo build --all-targets
|
|
|
|
- name: Run Rust tests
|
|
working-directory: ./gitignore-gen
|
|
run: cargo test
|