chore: bump to rust 2024 edition #13
Workflow file for this run
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: | |
| - master | |
| - 'ft*' | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Build, Lint, and Test | |
| runs-on: ubuntu-latest | |
| container: | |
| image: rust:alpine | |
| steps: | |
| - name: Install Alpine dependencies | |
| run: apk add --no-cache git musl-dev | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust components | |
| run: rustup component add clippy rustfmt | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-alpine-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| - name: Lint with Clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Run Tests | |
| run: cargo test --verbose | |
| publish: | |
| name: Publish to Crates.io | |
| runs-on: ubuntu-latest | |
| needs: test | |
| environment: master | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build Release | |
| run: cargo build --release | |
| - name: Publish to Crates.io | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: cargo publish --token $CARGO_REGISTRY_TOKEN |