Bump actions/checkout from 5 to 6 #130
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"] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: ["main"] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| ################ | |
| # Pull Request # | |
| ################ | |
| pr: | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| needs: | |
| - clippy | |
| - feature | |
| - fuzz | |
| - msrv | |
| - rustdoc | |
| - rustfmt | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: ${{ needs.clippy.result == 'success' | |
| && needs.feature.result == 'success' | |
| && needs.fuzz.result == 'success' | |
| && needs.msrv.result == 'success' | |
| && needs.rustdoc.result == 'success' | |
| && needs.rustfmt.result == 'success' | |
| && needs.test.result == 'success' }} | |
| ########################## | |
| # Linting and formatting # | |
| ########################## | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - run: make cargo.lint | |
| rustfmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - run: make cargo.fmt check=yes | |
| ########### | |
| # Testing # | |
| ########### | |
| feature: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| feature: | |
| - <none> | |
| - into-regex | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - run: cargo +nightly update -Z minimal-versions | |
| - run: cargo check -p cucumber-expressions --no-default-features | |
| ${{ (matrix.feature != '<none>' | |
| && format('--features {0}', matrix.feature)) | |
| || '' }} | |
| env: | |
| RUSTFLAGS: -D warnings | |
| fuzz: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - alternation | |
| - expression | |
| - into-regex | |
| - optional | |
| - parameter | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| - run: cargo install cargo-fuzz | |
| - run: make cargo.fuzz target=${{ matrix.target }} time=60 | |
| msrv: | |
| name: MSRV | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| msrv: ["1.85.0"] | |
| os: ["ubuntu", "macOS", "windows"] | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.msrv }} | |
| - run: cargo +nightly update -Z minimal-versions | |
| - run: make test.cargo | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| toolchain: ["stable", "beta", "nightly"] | |
| os: ["ubuntu", "macOS", "windows"] | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: rust-src | |
| - run: cargo install cargo-careful | |
| if: ${{ matrix.toolchain == 'nightly' }} | |
| - run: make test.cargo | |
| careful=${{ (matrix.toolchain == 'nightly' && 'yes') | |
| || 'no' }} | |
| ################# | |
| # Documentation # | |
| ################# | |
| rustdoc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| - run: make cargo.doc private=yes docsrs=yes open=no | |
| env: | |
| RUSTFLAGS: -D warnings | |
| ############# | |
| # Releasing # | |
| ############# | |
| publish: | |
| name: publish (crates.io) | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| needs: ["release-github"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - run: cargo publish -p cucumber-expressions | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CRATESIO_TOKEN }} | |
| release-github: | |
| name: release (GitHub) | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| needs: | |
| - clippy | |
| - feature | |
| - fuzz | |
| - msrv | |
| - rustdoc | |
| - rustfmt | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Parse release version | |
| id: release | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" | |
| >> $GITHUB_OUTPUT | |
| - name: Verify release version matches Cargo manifest | |
| run: | | |
| test "${{ steps.release.outputs.version }}" \ | |
| == "$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f2)" | |
| - name: Ensure CHANGELOG date is today | |
| run: | | |
| today="$(date '+%Y-%m-%d')" | |
| changelog="$(grep -E '^## \[${{ steps.release.outputs.version }}\] ·'\ | |
| CHANGELOG.md \ | |
| | cut -d' ' -f4 | tr -d ' ')" | |
| echo "Changelog: $changelog" | |
| echo "Today: $today" | |
| [ "$changelog" = "$today" ] | |
| - name: Parse CHANGELOG link | |
| id: changelog | |
| run: echo "link=${{ github.server_url }}/${{ github.repository }}/blob/v${{ steps.release.outputs.version }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.version }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)" | |
| >> $GITHUB_OUTPUT | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ steps.release.outputs.version }} | |
| body: | | |
| [API docs](https://docs.rs/cucumber-expressions/${{ steps.release.outputs.version }}) | |
| [Changelog](${{ steps.changelog.outputs.link }}) | |
| prerelease: ${{ contains(steps.release.outputs.version, '-') }} |