ci fixes - formatting, pre-commit, license (#26) #129
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: Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| release: | |
| types: [ published ] | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: taiki-e/install-action@v2 | |
| with: { tool: just } | |
| - uses: actions/checkout@v4 | |
| with: { submodules: recursive } | |
| - name: Ensure this crate has not yet been published (on release) | |
| if: github.event_name == 'release' && matrix.type == 'latest' | |
| run: just check-if-published | |
| - uses: Swatinem/rust-cache@v2 | |
| if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
| - run: just -v ci-test | |
| - name: Check semver | |
| uses: obi1kenobi/cargo-semver-checks-action@v2 | |
| - name: Test packaging for publish | |
| run: | | |
| rustup install nightly --profile minimal | |
| just test-publish | |
| msrv: | |
| name: Test MSRV | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: taiki-e/install-action@v2 | |
| with: { tool: just } | |
| - uses: actions/checkout@v4 | |
| with: { submodules: recursive } | |
| - uses: Swatinem/rust-cache@v2 | |
| if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
| - name: Read crate metadata | |
| id: metadata | |
| run: echo "value=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ steps.metadata.outputs.value }} | |
| components: rustfmt | |
| - run: just -v ci-test-msrv |