-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.x - archetype 3.3.0 compat & backports (#1072)
Backport of #1070 to 3.x Also backport the following to ease the cherry picking: - Maven Archetype 3.3.0 compatibility #1070 - Pipeline updates #1056 - Inline spotbugs lifecycle #1046 - Helidon Archetype Maven Plugin - Update integration-test mojo #1043 - 4.x: Upgrade github actions to v4 #1037 - 4.x: Add Upload Staged Artifacts step to release workflow #1035 - Upgrade asm to 9.5 and asciidoctorj to 2.5.11 #1029 - Guava upgrade #1027 - Upgrade maven-core and other maven libs to 3.8.8 #1025 - Make maven-archiver compile scope #1024 - Cleanup and dependency reduction #1023 - Dependency upgrade pass 2 #1022 - Upgrade snakeyaml to 2.0 #1021 - Remove support for site lifecycle and dependency on doxia #1020 - Add dependency check plugin #1019 - Uptake Maven 3.9.x #1004
- Loading branch information
1 parent
de71c56
commit b201572
Showing
48 changed files
with
859 additions
and
1,602 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# Copyright (c) 2023 Oracle and/or its affiliates. | ||
# Copyright (c) 2023, 2024 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
@@ -18,15 +18,15 @@ name: 'Common Job Steps' | |
description: A composite action that abstracts the common steps needed to implement a job | ||
inputs: | ||
native-image: | ||
description: Wether to setup GraalVM native-image | ||
description: Whether to setup GraalVM native-image | ||
required: false | ||
default: 'false' | ||
maven-cache: | ||
description: Wether to cache the Maven local repository (read-only or read-write) | ||
description: Whether to cache the Maven local repository (read-only or read-write) | ||
required: false | ||
default: 'read-only' | ||
build-cache: | ||
description: Wether to cache the Maven build (read-only or read-write) | ||
description: Whether to cache the Maven build (read-only or read-write) | ||
required: false | ||
default: '' | ||
build-cache-id: | ||
|
@@ -56,49 +56,23 @@ inputs: | |
description: Path of the files to include in the artifact | ||
required: false | ||
default: '' | ||
archive-test-results: | ||
description: Wether to archive test results (excluded on windows) | ||
required: false | ||
default: 'false' | ||
test-matrix: | ||
description: | | ||
A JSON matrix with a "group" dimension, and a "groups" object to resolve Maven modules | ||
from glob expressions. | ||
The resolved modules are added in the include objects with a param "module". | ||
A 'misc' group is always added to represent everything else by negating all the resolved modules (E.g. '!dir1,!dir2'). | ||
E.g. | ||
{ | ||
"os": [ "ubuntu-20.04", "windows-2022" ], | ||
"group": [ "group1", "group2", "misc" ], | ||
"include": [ | ||
{ "os": "ubuntu-20.04", "platform": "linux" }, | ||
{ "os": "windows-2022", "platform": "windows" } | ||
] | ||
"groups": { | ||
"group1": [ "dir1/**", "dir2/**" ], | ||
"group2": [ "dir3/**" ] | ||
} | ||
} | ||
test-artifact-name: | ||
description: Name of the test artifact to create (excluded on windows), if non empty tests are archived | ||
required: false | ||
default: '' | ||
outputs: | ||
test-matrix: | ||
value: ${{ steps.test-matrix.outputs.matrix }} | ||
description: | | ||
E.g. | ||
groups: [ group1, group2 ] | ||
includes: | ||
- group: group1 | ||
modules: dir1,dir2,dir2a | ||
- group: group2 | ||
modules: dir3,dir3a | ||
- group: misc | ||
modules: !dir1,!dir2,!dir2a,!dir3,!dir3a | ||
free-space: | ||
description: Whether to aggressively free disk space on the runner | ||
default: 'false' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- if: ${{ inputs.free-space == 'true' }} | ||
# See https://github.com/actions/runner-images/issues/2840 | ||
name: Free disk space | ||
shell: bash | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /usr/local/share/powershell | ||
- if: ${{ runner.os == 'Windows' }} | ||
name: Use GNU tar | ||
shell: cmd | ||
|
@@ -109,43 +83,46 @@ runs: | |
git config --global core.eol lf | ||
- name: Set up GraalVM | ||
if: ${{ inputs.native-image == 'true' }} | ||
uses: graalvm/setup-graalvm@v1.1.2.1 | ||
uses: graalvm/[email protected] | ||
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
version: ${{ env.GRAALVM_VERSION }} | ||
components: 'native-image' | ||
check-for-updates: 'false' | ||
set-java-home: 'false' | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3.11.0 | ||
uses: actions/setup-java@v4.1.0 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Cache local Maven repository (read-write) | ||
if: ${{ inputs.maven-cache == 'read-write' }} | ||
uses: actions/cache@v3.3.1 | ||
uses: actions/cache@v4.0.2 | ||
with: | ||
# See https://github.com/actions/toolkit/issues/713 | ||
# Include must not match top level directories | ||
path: | | ||
.m2/repository/** | ||
!.m2/repository/io/helidon/build-tools | ||
.m2/repository/**/*.* | ||
!.m2/repository/io/helidon/build-tools/** | ||
enableCrossOsArchive: true | ||
key: local-maven-${{ hashFiles('**/pom.xml') }} | ||
# only hash top-level poms to keep it fast | ||
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }} | ||
restore-keys: | | ||
local-maven- | ||
- name: Cache local Maven repository (read-only) | ||
if: ${{ inputs.maven-cache == 'read-only' }} | ||
uses: actions/cache/restore@v3.3.1 | ||
uses: actions/cache/restore@v4.0.2 | ||
with: | ||
path: | | ||
.m2/repository/** | ||
!.m2/repository/io/helidon/build-tools | ||
.m2/repository/**/*.* | ||
!.m2/repository/io/helidon/build-tools/** | ||
enableCrossOsArchive: true | ||
key: local-maven-${{ hashFiles('**/pom.xml') }} | ||
key: local-maven-${{ hashFiles('*/pom.xml', 'pom.xml') }} | ||
restore-keys: | | ||
local-maven- | ||
- name: Build cache (read-write) | ||
if: ${{ inputs.build-cache == 'read-write' }} | ||
uses: actions/cache@v3.3.1 | ||
uses: actions/cache@v4.0.2 | ||
with: | ||
path: | | ||
./**/target/** | ||
|
@@ -157,7 +134,7 @@ runs: | |
build-cache-${{ github.run_id }}- | ||
- name: Build cache (read-only) | ||
if: ${{ inputs.build-cache == 'read-only' }} | ||
uses: actions/cache/restore@v3.3.1 | ||
uses: actions/cache/restore@v4.0.2 | ||
with: | ||
path: | | ||
./**/target/** | ||
|
@@ -168,13 +145,6 @@ runs: | |
restore-keys: | | ||
build-cache-${{ github.run_id }}-${{ github.run_attempt }}- | ||
build-cache-${{ github.run_id }}- | ||
- name: Populate Maven cache | ||
if: ${{ inputs.maven-cache == 'read-write' }} | ||
run: | | ||
mvn ${MAVEN_ARGS} -T 8 \ | ||
-Dmaven.repo.local=${{ github.workspace }}/.m2/repository \ | ||
dependency:go-offline | ||
shell: bash | ||
- name: Exec | ||
env: | ||
GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }} | ||
|
@@ -183,26 +153,23 @@ runs: | |
MAVEN_ARGS: | | ||
${{ env.MAVEN_ARGS }} | ||
-Dmaven.repo.local=${{ github.workspace }}/.m2/repository | ||
-Dcache.record=${{ inputs.build-cache == 'read-write' }} | ||
run: ${{ inputs.run }} | ||
shell: bash | ||
- id: test-matrix | ||
if: ${{ inputs.test-matrix != '' }} | ||
run: ./.github/actions/common/matrix.sh '${{ inputs.test-matrix }}' >> "${GITHUB_OUTPUT}" | ||
shell: bash | ||
- name: Archive test results | ||
# https://github.com/actions/upload-artifact/issues/240 | ||
if: ${{ inputs.archive-test-results == 'true' && runner.os != 'Windows' && always() }} | ||
uses: actions/upload-artifact@v3.1.2 | ||
if: ${{ inputs.test-artifact-name != '' && runner.os != 'Windows' && always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: 'ignore' | ||
name: test-results | ||
name: ${{ inputs.test-artifact-name }} | ||
path: | | ||
**/target/surefire-reports/*.txt | ||
**/target/failsafe-reports/*.txt | ||
**/target/it/**/*.log | ||
- name: Archive artifacts | ||
if: ${{ inputs.artifact-name != '' && inputs.artifact-path != '' && always() }} | ||
uses: actions/upload-artifact@v3.1.2 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: 'ignore' | ||
name: ${{ inputs.artifact-name }} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.