-
Notifications
You must be signed in to change notification settings - Fork 151
build: update GHA workflow config #900
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | ||
| # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax | ||
| name: Validate | ||
|
|
||
| on: | ||
| on: # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows | ||
| push: | ||
| branches-ignore: # build all branches except: | ||
| - 'dependabot/**' # prevent workflow being triggered twice (once for commit to the branch and once for opening/syncing the PR) | ||
| tags-ignore: # don't build tags | ||
| tags-ignore: # don't build tags | ||
| - '**' | ||
| paths-ignore: | ||
| - '**/*.md' | ||
|
|
@@ -18,27 +18,99 @@ on: | |
| - '.editorconfig' | ||
| - '.git*' | ||
| - '.github/*.yml' | ||
| workflow_dispatch: # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ | ||
| workflow_dispatch: | ||
| # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch | ||
| inputs: | ||
| debug-with-ssh: | ||
| description: "When to open an SSH session for post-build debugging:" | ||
| default: never | ||
| type: choice | ||
| options: [ always, on_failure, on_failure_or_cancelled, never ] | ||
| debug-with-ssh-only-for-actor: | ||
| description: "Restrict SSH debug session access to the GitHub user who triggered the workflow" | ||
| default: true | ||
| type: boolean | ||
|
|
||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
|
|
||
| jobs: | ||
|
|
||
| ########################################################### | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| ########################################################### | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| os: # https://github.com/actions/runner-images#available-images | ||
| - ubuntu-latest | ||
| - macos-15-intel # Intel | ||
| - macos-latest # ARM | ||
| - windows-latest | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 20 | ||
|
|
||
| steps: | ||
| - name: "Show: GitHub context" | ||
| env: | ||
| GITHUB_CONTEXT: ${{ toJSON(github) }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have left this out of #918 - the github context has some amount of secrets which GH replaces with Same for |
||
| run: echo $GITHUB_CONTEXT | ||
|
|
||
|
|
||
| - name: "Show: environment variables" | ||
| run: env | sort | ||
|
|
||
|
|
||
| - name: Git Checkout | ||
| uses: actions/checkout@v4 # https://github.com/actions/checkout | ||
| uses: actions/checkout@v5 # https://github.com/actions/checkout | ||
|
|
||
|
|
||
| - name: Set up JDK 11 ☕ | ||
| uses: actions/setup-java@v4 | ||
| - name: "Install: JDK 11 ☕ for compilation/tests" | ||
| uses: actions/setup-java@v5 # https://github.com/actions/setup-java | ||
| with: | ||
| distribution: temurin | ||
| java-version: 11 | ||
| distribution: 'temurin' | ||
| cache: gradle | ||
|
|
||
|
|
||
| - name: "Install: JDK 17 ☕ for running gradle" | ||
| uses: actions/setup-java@v5 # https://github.com/actions/setup-java | ||
| with: | ||
| distribution: temurin | ||
| java-version: 17 | ||
| cache: gradle | ||
|
|
||
|
|
||
| - name: Build with Gradle 🏗️ | ||
| run: ./gradlew build | ||
|
|
||
|
|
||
| ################################################## | ||
| # Setup SSH debug session | ||
| ################################################## | ||
| - name: "SSH session for debugging: check" | ||
| id: DEBUG_SSH_SESSSION_CHECK | ||
| if: always() | ||
| run: | | ||
| set -eu | ||
|
|
||
| when="${{ inputs.debug-with-ssh }}" | ||
|
|
||
| if [[ $when == "always" ]] || case "${{ job.status }}" in | ||
| success) [[ $when == "always" ]] ;; | ||
| cancelled) [[ $when == "on_failure_or_cancelled" ]] ;; | ||
| failure) [[ $when == "on_failure"* ]] ;; | ||
| esac; then | ||
| echo "start_ssh_session=true" | tee -a "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
|
|
||
| - name: "SSH session for debugging: start" | ||
| uses: mxschmitt/action-tmate@v3 # https://github.com/mxschmitt/action-tmate | ||
| if: always() && steps.DEBUG_SSH_SESSSION_CHECK.outputs.start_ssh_session | ||
| with: | ||
| limit-access-to-actor: ${{ inputs.debug-with-ssh-only-for-actor }} | ||
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,9 @@ | ||
| org.gradle.daemon=false | ||
| org.gradle.java.installations.auto-detect=true | ||
| org.gradle.java.installations.auto-download=true | ||
|
|
||
| # Optionally, you can hint custom JDK locations (semicolon-separated on Windows): | ||
| # org.gradle.java.installations.paths=C:\\jdks\\jdk-11;C:\\jdks\\jdk-21 | ||
|
|
||
| # To run Gradle itself on a specific JDK (machine-specific), prefer setting JAVA_HOME | ||
| # before invoking Gradle or use --java-home on the command line. |
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left the SSH parts out of #918 - I don't understand full ramifications of such an inclusion. If you think this is important, please create a new focused PR with this.