-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
114 additions
and
59 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ | |
*.zsh text eol=lf | ||
*.lua text | ||
*.php text | ||
*.py text | ||
*.python text | ||
*.sql text | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com) | ||
# SPDX-FileContributor: Sebastian Thomschke | ||
# SPDX-FileContributor: Sebastian Thomschke (Vegard IT GmbH) | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/depcheck-maven-plugin | ||
# | ||
|
@@ -33,7 +33,7 @@ on: | |
required: false | ||
default: '' | ||
debug-with-ssh: | ||
description: "Start an SSH session for debugging purposes after tests ran:" | ||
description: "Start an SSH session for debugging purposes at the end of the build:" | ||
default: never | ||
type: choice | ||
options: [ always, on_failure, on_failure_or_cancelled, never ] | ||
|
@@ -53,8 +53,12 @@ defaults: | |
run: | ||
shell: bash | ||
|
||
|
||
jobs: | ||
build: | ||
|
||
########################################################### | ||
maven-build: | ||
########################################################### | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
|
@@ -70,19 +74,23 @@ jobs: | |
- java: 20 | ||
may_create_release: false | ||
experimental: false | ||
|
||
steps: | ||
- name: Show environment variables | ||
run: env | sort | ||
|
||
|
||
- name: Git Checkout | ||
uses: actions/checkout@v4 #https://github.com/actions/checkout | ||
uses: actions/checkout@v4 # https://github.com/actions/checkout | ||
|
||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v4 #https://github.com/actions/setup-java | ||
|
||
- name: "Install: JDK ${{ env.JAVA_VERSION }}" | ||
uses: actions/setup-java@v4 # https://github.com/actions/setup-java | ||
with: | ||
distribution: temurin | ||
java-version: ${{ matrix.java }} | ||
|
||
|
||
# reusing CDS archives of the same JVM randomly fails in GitHub Actions with | ||
# "An error has occurred while processing the shared archive file. shared class paths mismatch" | ||
#- name: Calculate Java version checksum | ||
|
@@ -96,22 +104,18 @@ jobs: | |
# ~/.xshare/${{ steps.java-version-checksum.outputs.md5sum }} | ||
# key: ${{ runner.os }}-xshare-${{ steps.java-version-checksum.outputs.md5sum }} | ||
|
||
- name: "Cache: Local Maven Repository" | ||
uses: actions/cache@v3 | ||
|
||
- name: "Cache: Restore" | ||
id: cache-restore | ||
if: ${{ !env.ACT }} # https://github.com/nektos/act#skipping-steps | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.m2/bin | ||
~/.m2/repository | ||
!~/.m2/repository/com/vegardit/maven | ||
key: ${{ runner.os }}-mvnrepo-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-mvnrepo- | ||
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | ||
|
||
- name: "Cache: Maven Binaries" | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.m2/bin | ||
key: ${{ runner.os }}-mvnbin-${{ hashFiles('.ci/build.sh') }} | ||
|
||
- name: Test with Maven | ||
id: maven-test | ||
|
@@ -124,6 +128,7 @@ jobs: | |
run: | | ||
bash .ci/build.sh ${{ github.event.inputs.additional_maven_args }} | ||
- name: Build with Maven | ||
id: maven-build | ||
if: ${{ matrix.may_create_release && !env.ACT }} | ||
|
@@ -149,6 +154,7 @@ jobs: | |
echo 'has_jacoco_results=true' >> $GITHUB_OUTPUT | ||
fi | ||
- name: Publish test coverage to codeclimate.com | ||
uses: paambaati/[email protected] # https://github.com/paambaati/codeclimate-action | ||
if: ${{ matrix.may_create_release && steps.maven-build.outputs.has_jacoco_results && !env.ACT }} | ||
|
@@ -161,41 +167,72 @@ jobs: | |
${{ github.workspace }}/target/site/jacoco-it/jacoco.xml:jacoco | ||
################################################## | ||
# Cache Update | ||
# See https://github.com/actions/cache/issues/342 | ||
################################################## | ||
- name: "Cache: Delete Previous" | ||
if: ${{ steps.cache-restore.outputs.cache-hit && !env.ACT }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
# "|| true" is to avoid "Error: Resource not accessible by integration" from failing the job | ||
gh actions-cache delete ${{ steps.cache-restore.outputs.cache-primary-key }} --confirm || true | ||
- name: "Cache: Update" | ||
uses: actions/cache/save@v3 | ||
if: ${{ always() && !cancelled() && !env.ACT }} # save cache even fails | ||
with: | ||
path: | | ||
~/.m2/bin | ||
~/.m2/repository | ||
!~/.m2/repository/com/vegardit/maven | ||
!~/.m2/repository/*SNAPSHOT* | ||
key: ${{ steps.cache-restore.outputs.cache-primary-key }} | ||
|
||
|
||
################################################## | ||
# Setup SSH debug session | ||
################################################## | ||
- name: "SSH session for debugging: check" | ||
id: DEBUG_SSH_SESSSION_CHECK | ||
if: always() | ||
shell: bash | ||
run: | | ||
set -eu | ||
job_filter_pattern="${{ inputs.debug-with-ssh-only-jobs-matching }}" | ||
echo "job_filter: $job_filter_pattern" | ||
job_info=$(echo "$GITHUB_JOB ${{ runner.os }} haxe-${{ matrix.haxe-version }}" | tr -d '\n') | ||
job_info=$(echo "$GITHUB_JOB ${{ runner.os }} java-${{ matrix.java }}" | tr -d '\n') | ||
echo "job_info: $job_info" | ||
when="${{ inputs.debug-with-ssh }}" | ||
if [[ "$job_info" =~ .*$job_filter_pattern.* ]] && case "${{ job.status }}" in | ||
success) [[ "${{ inputs.debug-with-ssh }}" == always ]] ;; | ||
cancelled) [[ "${{ inputs.debug-with-ssh }}" == on_failure_or_cancelled ]] ;; | ||
failure) [[ "${{ inputs.debug-with-ssh }}" =~ on_failure.* ]] ;; | ||
if [[ $when == "always" ]] || [[ "$job_info" =~ .*$job_filter_pattern.* ]] && case "${{ job.status }}" in | ||
success) [[ $when == "always" ]] ;; | ||
cancelled) [[ $when == "on_failure_or_cancelled" ]] ;; | ||
failure) [[ $when == "on_failure"* ]] ;; | ||
esac; then | ||
echo "start_session=true" | tee -a "$GITHUB_OUTPUT" | ||
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_session | ||
if: always() && steps.DEBUG_SSH_SESSSION_CHECK.outputs.start_ssh_session | ||
with: | ||
limit-access-to-actor: ${{ inputs.debug-with-ssh-only-for-actor }} | ||
|
||
|
||
########################################################### | ||
dependabot-pr-auto-merge: | ||
needs: build | ||
########################################################### | ||
needs: maven-build | ||
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }} | ||
runs-on: ubuntu-latest | ||
|
||
concurrency: dependabot-pr-auto-merge | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
@@ -207,6 +244,7 @@ jobs: | |
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
if: | | ||
${{ | ||
|
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
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
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