initial commit #13
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: ci | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: cargo test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: [stable, beta, nightly, 1.80.0] # stable, beta, nightly, and MSRV | |
| mode: ["", "--release"] | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| - name: install rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: cache rust toolchain | |
| uses: Swatinem/rust-cache@v2 | |
| - name: cargo test | |
| run: cargo test ${{ matrix.mode }} | |
| deny: | |
| name: cargo deny | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| - name: cargo deny | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| fmt: | |
| name: cargo fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| - name: install rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: cargo fmt | |
| run: cargo fmt --all -- --check | |
| doc: | |
| name: cargo doc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| - name: install rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: cargo doc | |
| run: cargo doc --no-deps | |
| clippy: | |
| name: cargo clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v5 | |
| - name: install rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: cargo clippy | |
| run: cargo clippy --bins -- -D warnings |