-
Notifications
You must be signed in to change notification settings - Fork 3
Add PR build testing and auto-merge for dependency PRs #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d670374
Add design spec for PR build testing + auto-merge
compscidr 946a0e2
Add implementation plan for PR build testing + auto-merge
compscidr 84f9d06
Add PR build workflow with 'All builds passed' gate check
compscidr 7397bfe
Use AUTOMERGE_PAT in SDK update workflow and enable auto-merge
compscidr 38d4b1d
Clarify in spec why build.yml only extracts VERSION
compscidr 73c7042
Harden build.yml with read-only permissions; fix spec concurrency wor…
compscidr 1a364c0
Shrink SDK workflow token permissions; guard against expired PAT
compscidr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: Build container (PR) | ||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: build-pr-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| matrix: | ||
| name: Generate build matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.generate.outputs.matrix }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Generate matrix from matrix.json | ||
| id: generate | ||
| run: | | ||
| DEFAULT_JDK=$(jq -r '.default_jdk' matrix.json) | ||
| MATRIX=$(jq -c --arg default "$DEFAULT_JDK" '{ | ||
| "include": [.java_versions[] | { | ||
| "java_version": ., | ||
| "is_default_jdk": (. == $default) | ||
| }] | ||
| }' matrix.json) | ||
| echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT | ||
|
|
||
| build: | ||
| name: Build JDK ${{ matrix.java_version }} | ||
| needs: matrix | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Extract versions from Dockerfile | ||
| id: versions | ||
| run: | | ||
| set -euo pipefail | ||
| RUNNER_TAG=$(grep -m1 '^ARG VERSION=' Dockerfile | cut -d= -f2) | ||
|
|
||
| if [ -z "$RUNNER_TAG" ]; then | ||
| echo "::error::Failed to extract versions from Dockerfile" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "runner_tag=${RUNNER_TAG}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
|
|
||
| - name: Build (no push) | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
| context: . | ||
| push: false | ||
| build-args: | | ||
| VERSION=${{ steps.versions.outputs.runner_tag }} | ||
| JAVA_VERSION=${{ matrix.java_version }} | ||
|
|
||
| gate: | ||
| name: All builds passed | ||
| needs: [matrix, build] | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check that all required jobs succeeded | ||
| run: | | ||
| if [ "${{ needs.matrix.result }}" != "success" ] || [ "${{ needs.build.result }}" != "success" ]; then | ||
| echo "::error::A required job failed or was cancelled (matrix: ${{ needs.matrix.result }}, build: ${{ needs.build.result }})" | ||
| exit 1 | ||
| fi | ||
| echo "All builds succeeded" | ||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.