Feat/dialog icons #85
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: Commit history checks | |
| on: | |
| pull_request: | |
| jobs: | |
| # First, enumerate the intermediate commits in the PR. | |
| # Single-commit PRs are already fully covered by test-all-builds.yml, | |
| # so there's nothing new to verify. | |
| list-commits: | |
| if: github.event.pull_request.commits > 1 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| commits: ${{ steps.list.outputs.commits }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Trust workspace for git | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Fetch base branch | |
| run: | | |
| # NOT `--depth=1`: it marks the repo shallow at origin/master | |
| # and `git log origin/master..HEAD~` can't walk past the | |
| # boundary, returning the entire project history instead of | |
| # the PR range. fetch-depth: 0 on actions/checkout already | |
| # populated everything, so this is essentially free. | |
| git fetch --no-tags --prune origin \ | |
| "+refs/heads/${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}" | |
| - id: list | |
| name: List intermediate commits | |
| run: | | |
| # HEAD is the PR tip -- already covered by test-all-builds.yml. | |
| range="origin/${GITHUB_BASE_REF}..HEAD~" | |
| # Emit "<full sha>\t<short sha> <subject>" per commit, then turn | |
| # it into a JSON array of {sha, name} objects for matrix.include. | |
| commits=$(git log --reverse --format='%H%x09%h %s' "$range" \ | |
| | jq -R -s -c ' | |
| split("\n") | |
| | map(select(length > 0)) | |
| | map(split("\t")) | |
| | map({sha: .[0], name: .[1]}) | |
| ') | |
| echo "Intermediate commits: $commits" | |
| echo "commits=$commits" >> "$GITHUB_OUTPUT" | |
| # Then run CI checks per commit in parallel inside the stable IDF image. | |
| check-commit: | |
| needs: list-commits | |
| if: needs.list-commits.outputs.commits != '[]' && needs.list-commits.outputs.commits != '' | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 | |
| container: espressif/idf:v6.0.1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.list-commits.outputs.commits) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ matrix.sha }} | |
| submodules: 'recursive' | |
| - name: Trust workspace for git | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Show commit | |
| run: git log -1 --oneline | |
| - name: Install clang-format | |
| run: apt-get update && apt-get install -y clang-format | |
| - name: Configure git identity (required by rebase) | |
| run: | | |
| git config user.email "ci@example.com" | |
| git config user.name "CI" | |
| - name: Run checks on each commit (excluding PR tip) | |
| run: | | |
| . $IDF_PATH/export.sh | |
| bash scripts/ci-checks.sh |