chore: update justfile and CI steps, no functional changes #70
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: | |
| - main | |
| - staging | |
| - trying | |
| - release/** | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@v2 | |
| with: { tool: 'just,cargo-binstall' } | |
| - run: just ci-test | |
| test-msrv: | |
| name: Test MSRV | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@v2 | |
| with: { tool: 'just,cargo-binstall,cargo-minimal-versions,cargo-hack' } | |
| - name: Read MSRV | |
| id: msrv | |
| run: echo "value=$(just get-msrv)" >> $GITHUB_OUTPUT | |
| - name: Install nightly Rust for minimal dependency resolution | |
| uses: dtolnay/rust-toolchain@stable | |
| with: { toolchain: nightly } | |
| - name: Install MSRV Rust ${{ steps.msrv.outputs.value }} | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ steps.msrv.outputs.value }} | |
| - run: just ci-test-msrv | |
| coverage: | |
| name: Code Coverage | |
| if: github.event_name != 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@v2 | |
| with: { tool: 'just,cargo-llvm-cov' } | |
| - run: just ci-coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: target/llvm-cov/lcov.info | |
| # This job checks if any of the previous jobs failed or were canceled. | |
| # This approach also allows some jobs to be skipped if they are not needed. | |
| ci-passed: | |
| needs: [ test, test-msrv ] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Result of the needed steps | |
| run: echo "${{ toJSON(needs) }}" | |
| - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: exit 1 | |
| # Release unpublished packages or create a PR with changes | |
| release-plz: | |
| needs: [ ci-passed ] | |
| if: | | |
| always() | |
| && needs.ci-passed.result == 'success' | |
| && github.event_name == 'push' | |
| && github.ref == 'refs/heads/main' | |
| && github.repository_owner == 'georust' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| concurrency: | |
| group: release-plz-${{ github.ref }} | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: { fetch-depth: 0 } | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Publish to crates.io if crate's version is newer | |
| uses: release-plz/action@v0.5 | |
| id: release | |
| with: { command: release } | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} | |
| - if: ${{ steps.release.outputs.releases_created == 'false' }} | |
| name: If version is the same, create a PR proposing new version and changelog for the next release | |
| uses: release-plz/action@v0.5 | |
| with: { command: release-pr } | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} |