🤖 fix false negative when using jq to determine msrv #1063
This file contains 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: | |
paths: ['**/*.rs', '**/*.yml', '**/*.toml', '**/*.lock'] | |
pull_request: | |
paths: ['**/*.rs', '**/*.yml', '**/*.toml', '**/*.lock'] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name == 'main' && github.sha || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Debounce: | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
outputs: | |
skip: ${{ steps.debounce.outputs.skip }} | |
steps: | |
- name: Debounce | |
if: github.ref_name != 'main' && github.event_name == 'push' | |
id: debounce | |
run: | | |
pr_branches=$(gh pr list --json headRefName --repo "$GITHUB_REPOSITORY") | |
echo "pr_branches=$pr_branches" | |
echo "GITHUB_REF_NAME=$GITHUB_REF_NAME" | |
if [[ $(echo "$pr_branches" | jq -r --arg ref_name "$GITHUB_REF_NAME" '.[] | select(.headRefName == $ref_name)') ]]; then | |
echo "Push to a branch that is associated with a pull request. Skipping redundant job." | |
echo "skip=true" >> "$GITHUB_OUTPUT" | |
fi | |
Lint: | |
needs: Debounce | |
if: needs.debounce.outputs.skip != 'true' | |
uses: ./.github/workflows/lint.yml | |
Test: | |
needs: Lint | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13, macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@nextest | |
- name: Run test | |
env: | |
RUST_BACKTRACE: full | |
CARGO_TERM_COLOR: always | |
run: cargo nextest run --verbose --profile ci | |
- name: Publish results | |
if: runner.os == 'Linux' | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: 'target/nextest/ci/junit.xml' | |
Release: | |
needs: Test | |
if: github.ref_name == 'main' | |
uses: ./.github/workflows/release.yml |