style: use string literal for magic (#60) #172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache Cargo registry + build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Rustfmt check | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cargo fmt --all -- --check | |
| - name: Clippy lint | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build release | |
| if: matrix.os == 'ubuntu-latest' | |
| run: cargo build --release | |
| - name: Cargo check | |
| run: cargo check --all-targets | |
| - name: Run tests | |
| run: cargo test --all-targets |