Dedicated GPIO bundle initial implementation #1833
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: API Baseline Check | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| merge_group: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Cancel any currently running workflows from the same PR, branch, or | |
| # tag when a new workflow is triggered. | |
| # | |
| # https://stackoverflow.com/a/66336834 | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| jobs: | |
| baseline-check: | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'breaking-change-esp-hal') }} | |
| env: | |
| CARGO_TARGET_DIR: ${{ github.workspace }}/target | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Detect label in merge queue | |
| if: github.event_name == 'merge_group' | |
| id: skip_in_merge_queue | |
| run: | | |
| COMMIT_MSG=$(git log -1 --pretty=%B) | |
| echo "Last commit message: $COMMIT_MSG" | |
| # Extract PR number from commit message if it follows conventional format | |
| PR_NUMBER="" | |
| if echo "$COMMIT_MSG" | grep -q "#"; then | |
| PR_NUMBER=$(echo "$COMMIT_MSG" | grep -o "#[0-9]*" | grep -o "[0-9]*") | |
| fi | |
| if [ -n "$PR_NUMBER" ]; then | |
| echo "Found PR number: $PR_NUMBER" | |
| LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name' 2>/dev/null || true) | |
| echo "PR labels:" | |
| echo "$LABELS" | |
| # Extract packages from "breaking-change-" labels | |
| PACKAGES="" | |
| if [ -n "$LABELS" ]; then | |
| # -o: only output matches, not rows | |
| # -P: Perl-compatible regular expressions | |
| # `(?<=)`: look-behind: match only if this is present, but do not make this part of the match | |
| PACKAGES=$(echo "$LABELS" \ | |
| | grep -oP '(?<=^breaking-change-)[a-z0-9-]+$' || true \ | |
| | tr '\n' ',' \ | |
| | sed 's/,$//') | |
| if [ -n "$PACKAGES" ]; then | |
| # TODO: skip only specific packages, not the whole check | |
| echo "Breaking change made for package(s): $PACKAGES" | |
| echo "skip_check=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "No breaking-change-* labels found" | |
| echo "skip_check=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| else | |
| echo "No labels found in commit message" | |
| echo "skip_check=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| else | |
| echo "No PR number found in commit message" | |
| echo "skip_check=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| # Install the Rust toolchain for Xtensa devices: | |
| - uses: esp-rs/[email protected] | |
| if: github.event_name != 'merge_group' || steps.skip_in_merge_queue.outputs.skip_check != 'true' | |
| with: | |
| version: 1.92.0.0 | |
| # Install the Rust stable toolchain for RISC-V devices: | |
| - uses: dtolnay/rust-toolchain@v1 | |
| if: github.event_name != 'merge_group' || steps.skip_in_merge_queue.outputs.skip_check != 'true' | |
| with: | |
| target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | |
| toolchain: stable | |
| components: rust-src | |
| - name: Semver-Check | |
| if: github.event_name != 'merge_group' || steps.skip_in_merge_queue.outputs.skip_check != 'true' | |
| shell: bash | |
| run: | | |
| cargo xcheck semver-check download-baselines | |
| cargo xcheck semver-check --chips esp32 check | |
| cargo xcheck semver-check --chips esp32s2 check | |
| cargo xcheck semver-check --chips esp32s3 check | |
| cargo xcheck semver-check --chips esp32c2 check | |
| cargo xcheck semver-check --chips esp32c3 check | |
| cargo xcheck semver-check --chips esp32c6 check | |
| cargo xcheck semver-check --chips esp32h2 check |