Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/base-windows-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
inputs:
quarkus-version:
type: string
description: 'Quarkus version to test `<repo>:<version>` (branch, tag, commit, or "latest")'
description: 'Quarkus version to test `<repo>:<version>`. The `<version>` can be a branch, tag, commit, or "latest".'
# "latest" is replaced by the latest release available in maven
default: "quarkusio/quarkus:main"
default: "quarkusio/quarkus:999-SNAPSHOT"
graalvm-version:
type: string
description: 'Mandrel version to test `<repo>:<version>` (branch, tag, or commit)'
Expand Down Expand Up @@ -73,14 +73,16 @@ jobs:
steps:
- id: process
run: |
echo "quarkus-repo=$(echo ${{ github.event.inputs.quarkus-version }} | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "quarkus-version=$(echo ${{ github.event.inputs.quarkus-version }} | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
QUARKUS_INPUT="${{ github.event.inputs.quarkus-version }}"
echo "quarkus-repo=$(echo $QUARKUS_INPUT | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "quarkus-version=$(echo $QUARKUS_INPUT | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
echo "mandrel-repo=$(echo ${{ github.event.inputs.graalvm-version }} | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "mandrel-version=$(echo ${{ github.event.inputs.graalvm-version }} | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
echo "mandrel-packaging-repo=$(echo ${{ github.event.inputs.mandrel-packaging-version }} | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "mandrel-packaging-version=$(echo ${{ github.event.inputs.mandrel-packaging-version }} | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
delegate:
needs: process-inputs
uses: ./.github/workflows/base-windows.yml
with:
quarkus-version: ${{ needs.process-inputs.outputs.quarkus-version }}
Expand Down
63 changes: 42 additions & 21 deletions .github/workflows/base-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string
description: 'Quarkus version to test (branch, tag, commit, or "latest")'
# "latest" is replaced by the latest release available in maven
default: "main"
default: "999-SNAPSHOT"
quarkus-repo:
type: string
description: 'The Quarkus repository to be used'
Expand Down Expand Up @@ -141,6 +141,7 @@ jobs:
quarkus-version: ${{ steps.version.outputs.quarkus-version }}
tests-matrix: ${{ steps.version.outputs.tests-matrix }}
artifacts-suffix: ${{ steps.suffix.outputs.suffix }}
use-snapshot: ${{ steps.version.outputs.use-snapshot }}
steps:
- id: suffix
run: |
Expand All @@ -162,21 +163,37 @@ jobs:
- name: Get Quarkus version and test matrix
id: version
run: |
if [ ${{ inputs.quarkus-version }} == "latest" ]
then
export QUARKUS_VERSION=$(curl -s https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/Final/ {print $3}' | sort -V | tail -n 1)
elif $(expr match "${{ inputs.quarkus-version }}" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
# Detect if this is a SNAPSHOT version
if echo "${{ inputs.quarkus-version }}" | grep -q "\-SNAPSHOT$"; then
echo "use-snapshot=true" >> $GITHUB_OUTPUT
echo "Detected SNAPSHOT version: ${{ inputs.quarkus-version }}"
else
export QUARKUS_VERSION=$(git ls-remote ${GITHUB_SERVER_URL}/${{ inputs.quarkus-repo }} | grep "refs/heads/${{ inputs.quarkus-version }}$\|refs/tags/${{ inputs.quarkus-version }}$" | cut -f 1)
fi
if [ "$QUARKUS_VERSION" == "" ]
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
echo "use-snapshot=false" >> $GITHUB_OUTPUT
echo "Not a SNAPSHOT version: ${{ inputs.quarkus-version }}"

if [ ${{ inputs.quarkus-version }} == "latest" ]
then
export QUARKUS_VERSION=$(curl -s https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/Final/ {print $3}' | sort -V | tail -n 1)
elif $(expr match "${{ inputs.quarkus-version }}" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
elif ! [[ "${{ inputs.quarkus-version }}" =~ ^[0-9a-f]{40}$ ]];
then
sha=$(gh api repos/${{ inputs.quarkus-repo }}/commits/${{ inputs.quarkus-version }} --jq .sha || echo "")
if [ "$sha" != "" ]; then
export QUARKUS_VERSION=$sha
else
export QUARKUS_VERSION=$(git ls-remote ${GITHUB_SERVER_URL}/${{ inputs.quarkus-repo }} | grep "refs/heads/${{ inputs.quarkus-version }}$\|refs/tags/${{ inputs.quarkus-version }}$" | cut -f 1)
fi
fi
if [ "$QUARKUS_VERSION" == "" ]
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
fi
fi
echo ${QUARKUS_VERSION}
echo "quarkus-version=${QUARKUS_VERSION}" >> $GITHUB_OUTPUT

curl --output native-tests.json https://raw.githubusercontent.com/${{ inputs.quarkus-repo }}/${QUARKUS_VERSION}/.github/native-tests.json
tests_json=$(jq -c '.include |= map(select(.["os-name"] | startswith("windows")))' native-tests.json)
echo ${tests_json}
Expand Down Expand Up @@ -385,7 +402,7 @@ jobs:
build-from-source: ${{ fromJson(needs.build-vars.outputs.build-from-source) }}
target-os: 'windows'
quarkus-repo: ${{ inputs.quarkus-repo }}
quarkus-version: ${{ needs.get-test-matrix.outputs.quarkus-version }}
quarkus-version: ${{ fromJson(needs.get-test-matrix.outputs.use-snapshot) == true && inputs.quarkus-version || needs.get-test-matrix.outputs.quarkus-version }}

native-tests:
name: Q IT ${{ matrix.category }}
Expand Down Expand Up @@ -428,13 +445,8 @@ jobs:
with:
repository: ${{ inputs.quarkus-repo }}
fetch-depth: 1
ref: ${{ needs.get-test-matrix.outputs.quarkus-version }}
ref: ${{ needs.build-quarkus.outputs.quarkus-sha || needs.get-test-matrix.outputs.quarkus-version }}
path: ${{ env.QUARKUS_PATH }}
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: base-windows-${{ needs.get-test-matrix.outputs.quarkus-version }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: base-windows-${{ needs.get-test-matrix.outputs.quarkus-version }}-maven-
# Use Java 17 for Quarkus as it doesn't work with Java 21 yet
- uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -462,6 +474,15 @@ jobs:
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Mandrel-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json.new
mv ~/.docker/config.json.new ~/.docker/config.json
fi
- name: Build Gradle plugins for snapshots
if: ${{ fromJson(needs.get-test-matrix.outputs.use-snapshot) == true && contains(matrix.test-modules, 'gradle') }}
shell: bash
run: |
cd ${QUARKUS_PATH}
# Build Gradle plugins that are not included in snapshots to avoid Gradle repository lookup
echo "Building Gradle plugins to local Maven repository"
./mvnw ${COMMON_MAVEN_ARGS} -Dquickly -pl devtools/gradle,devtools/gradle/gradle-application-plugin,devtools/gradle/gradle-extension-plugin -am install
cd -
- name: Build with Maven
env:
TEST_MODULES: ${{matrix.test-modules}}
Expand All @@ -481,7 +502,7 @@ jobs:
$opts=@()
-split $Env:NATIVE_TEST_MAVEN_OPTS | foreach { $opts += "`"$_`"" }
#if ( "${{ inputs.builder-image }}" -eq "null" ) {
mvn -f integration-tests -pl "$Env:TEST_MODULES" -amd "-Dquarkus.native.container-build=false" $opts install
mvn -f integration-tests -pl "$Env:TEST_MODULES" -am -amd "-Dquarkus.native.container-build=false" $opts install
#} else {
# mvn -pl $do_modules "-Dquarkus.native.container-build=true" "-Dquarkus.native.builder-image=${{ inputs.builder-image }}" $opts package
#}
Expand Down Expand Up @@ -602,7 +623,7 @@ jobs:
# Don't use SNAPSHOT version for release tags
if (${{ inputs.quarkus-version }} -match "^[0-9]+\.[0-9]+$") {
$QUARKUS_VERSION="${{ inputs.quarkus-version }}.999-SNAPSHOT"
} elseif (! ($QUARKUS_VERSION -match "^.*\.(Final|CR|Alpha|Beta)[0-9]?$")) {
} elseif (! ($QUARKUS_VERSION -match "-SNAPSHOT$") -and ! ($QUARKUS_VERSION -match "^.*\.(Final|CR|Alpha|Beta)[0-9]?$")) {
$QUARKUS_VERSION="999-SNAPSHOT"
}
Write-Host "$QUARKUS_VERSION"
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/base-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
inputs:
quarkus-version:
type: string
description: 'Quarkus version to test `<repo>:<version>` (branch, tag, commit, or "latest")'
description: 'Quarkus version to test `<repo>:<version>`. The `<version>` can be a branch, tag, commit, or "latest".'
# "latest" is replaced by the latest release available in maven
default: "quarkusio/quarkus:main"
default: "quarkusio/quarkus:999-SNAPSHOT"
graalvm-version:
type: string
description: 'Mandrel version to test `<repo>:<version>` (branch, tag, or commit)'
Expand All @@ -23,8 +23,8 @@ on:
default: "graalvm/mandrel-packaging:master"
build-type:
type: choice
description: 'Build distribution (graal/mandrel) from source or use released binaries, and control of maven should deploy locally'
default: "mandrel-source"
description: 'Build distribution (graal/mandrel) from source or use released binaries, and control if maven should deploy locally'
default: "mandrel-source-nolocalmvn"
options:
- "mandrel-source"
- "graal-source"
Expand Down Expand Up @@ -87,8 +87,9 @@ jobs:
steps:
- id: process
run: |
echo "quarkus-repo=$(echo ${{ github.event.inputs.quarkus-version }} | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "quarkus-version=$(echo ${{ github.event.inputs.quarkus-version }} | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
QUARKUS_INPUT="${{ github.event.inputs.quarkus-version }}"
echo "quarkus-repo=$(echo $QUARKUS_INPUT | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "quarkus-version=$(echo $QUARKUS_INPUT | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
echo "mandrel-repo=$(echo ${{ github.event.inputs.graalvm-version }} | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "mandrel-version=$(echo ${{ github.event.inputs.graalvm-version }} | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
echo "mandrel-packaging-repo=$(echo ${{ github.event.inputs.mandrel-packaging-version }} | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
Expand Down
73 changes: 49 additions & 24 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string
description: 'Quarkus version to test (branch, tag, commit, or "latest")'
# "latest" is replaced by the latest release available in maven
default: "main"
default: "999-SNAPSHOT"
quarkus-repo:
type: string
description: 'The Quarkus repository to be used'
Expand All @@ -31,7 +31,7 @@ on:
build-type:
type: string
description: 'Build distribution (Mandrel/GraalVM) from source or grab a release, and control of maven should deploy locally'
default: "mandrel-source"
default: "mandrel-source-nolocalmvn"
jdk:
type: string
description: 'OpenJDK to use. One of <feature-version>/ga, <feature-version>/ea, e.g. 17/ga or 17/ea (/ga and /ea suffixes are only relevant when building from source)'
Expand Down Expand Up @@ -180,6 +180,7 @@ jobs:
quarkus-version: ${{ steps.version.outputs.quarkus-version }}
tests-matrix: ${{ steps.version.outputs.tests-matrix }}
artifacts-suffix: ${{ steps.suffix.outputs.suffix }}
use-snapshot: ${{ steps.version.outputs.use-snapshot }}
env:
GH_TOKEN: ${{ github.token }}
steps:
Expand All @@ -204,27 +205,37 @@ jobs:
- name: Get Quarkus version and test matrix
id: version
run: |
if [ ${{ inputs.quarkus-version }} == "latest" ]
then
export QUARKUS_VERSION=$(curl -s https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/Final/ {print $3}' | sort -V | tail -n 1)
elif $(expr match "${{ inputs.quarkus-version }}" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
elif ! [[ "${{ inputs.quarkus-version }}" =~ ^[0-9a-f]{40}$ ]];
then
sha=$(gh api repos/${{ inputs.quarkus-repo }}/commits/${{ inputs.quarkus-version }} --jq .sha || echo "")
if [ "$sha" != "" ]; then
export QUARKUS_VERSION=$sha
else
export QUARKUS_VERSION=$(git ls-remote ${GITHUB_SERVER_URL}/${{ inputs.quarkus-repo }} | grep "refs/heads/${{ inputs.quarkus-version }}$\|refs/tags/${{ inputs.quarkus-version }}$" | cut -f 1)
# Detect if this is a SNAPSHOT version
if echo "${{ inputs.quarkus-version }}" | grep -q "\-SNAPSHOT$"; then
echo "use-snapshot=true" >> $GITHUB_OUTPUT
echo "Detected SNAPSHOT version: ${{ inputs.quarkus-version }}"
else
echo "use-snapshot=false" >> $GITHUB_OUTPUT
echo "Not a SNAPSHOT version: ${{ inputs.quarkus-version }}"

if [ ${{ inputs.quarkus-version }} == "latest" ]
then
export QUARKUS_VERSION=$(curl -s https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/Final/ {print $3}' | sort -V | tail -n 1)
elif $(expr match "${{ inputs.quarkus-version }}" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
elif ! [[ "${{ inputs.quarkus-version }}" =~ ^[0-9a-f]{40}$ ]];
then
sha=$(gh api repos/${{ inputs.quarkus-repo }}/commits/${{ inputs.quarkus-version }} --jq .sha || echo "")
if [ "$sha" != "" ]; then
export QUARKUS_VERSION=$sha
else
export QUARKUS_VERSION=$(git ls-remote ${GITHUB_SERVER_URL}/${{ inputs.quarkus-repo }} | grep "refs/heads/${{ inputs.quarkus-version }}$\|refs/tags/${{ inputs.quarkus-version }}$" | cut -f 1)
fi
fi
if [ "$QUARKUS_VERSION" == "" ]
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
fi
fi
if [ "$QUARKUS_VERSION" == "" ]
then
export QUARKUS_VERSION=${{ inputs.quarkus-version }}
fi
echo ${QUARKUS_VERSION}
echo "quarkus-version=${QUARKUS_VERSION}" >> $GITHUB_OUTPUT

curl --output native-tests.json https://raw.githubusercontent.com/${{ inputs.quarkus-repo }}/${QUARKUS_VERSION}/.github/native-tests.json
tests_json=$(jq -c '.include |= map(select(.["os-name"] | startswith("ubuntu")))' native-tests.json)
echo ${tests_json}
Expand Down Expand Up @@ -517,7 +528,7 @@ jobs:
maven-deploy-local: ${{ needs.build-vars.outputs.maven-deploy-local }}
target-os: 'linux'
quarkus-repo: ${{ inputs.quarkus-repo }}
quarkus-version: ${{ needs.get-test-matrix.outputs.quarkus-version }}
quarkus-version: ${{ fromJson(needs.get-test-matrix.outputs.use-snapshot) == true && inputs.quarkus-version || needs.get-test-matrix.outputs.quarkus-version }}
gh-runner: ${{ inputs.gh-runner }}

native-tests:
Expand Down Expand Up @@ -574,17 +585,27 @@ jobs:
with:
repository: ${{ inputs.quarkus-repo }}
fetch-depth: 1
ref: ${{ needs.get-test-matrix.outputs.quarkus-version }}
ref: ${{ needs.build-quarkus.outputs.quarkus-sha || needs.get-test-matrix.outputs.quarkus-version }}
path: ${{ env.QUARKUS_PATH }}
- name: Reclaim disk space
run: ${QUARKUS_PATH}/.github/ci-prerequisites.sh
run: |
${QUARKUS_PATH}/.github/ci-prerequisites.sh
- name: Update Docker Client User Agent
shell: bash
run: |
if [ -f ~/.docker/config.json ]; then
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Mandrel-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json.new
mv ~/.docker/config.json.new ~/.docker/config.json
fi
- name: Build Gradle plugins for snapshots
if: ${{ fromJson(needs.get-test-matrix.outputs.use-snapshot) == true && contains(matrix.test-modules, 'gradle') }}
shell: bash
run: |
cd ${QUARKUS_PATH}
# Build Gradle plugins that are not included in snapshots to avoid Gradle repository lookup
echo "Building Gradle plugins to local Maven repository"
./mvnw ${COMMON_MAVEN_ARGS} -Dquickly -pl devtools/gradle,devtools/gradle/gradle-application-plugin,devtools/gradle/gradle-extension-plugin -am install
cd -
- name: Build with Maven
env:
TEST_MODULES: ${{matrix.test-modules}}
Expand Down Expand Up @@ -639,7 +660,11 @@ jobs:
TEST_MODULES=$(echo $TEST_MODULES | tr ',' '\n' | grep -vi -E "$EXCLUDED_PATTERN" | paste -sd, -)
echo "Filtered TEST_MODULES after excluding '${{ inputs.excluded-native-test-modules }}': $TEST_MODULES"
fi
./mvnw -B --settings ${QUARKUS_PATH}/.github/mvn-settings.xml -f integration-tests -pl "$TEST_MODULES" -amd $BUILDER_IMAGE $NATIVE_TEST_MAVEN_OPTS $NEW_MAX_HEAP_SIZE
if [[ -n "$TEST_MODULES" ]]; then
echo "Running native tests for modules: $TEST_MODULES"
# Run tests
./mvnw -B --settings ${QUARKUS_PATH}/.github/mvn-settings.xml -f integration-tests -pl "$TEST_MODULES" -am -amd $BUILDER_IMAGE $NATIVE_TEST_MAVEN_OPTS $NEW_MAX_HEAP_SIZE
fi
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
Expand Down Expand Up @@ -752,7 +777,7 @@ jobs:
then
# release branches use the branch name followed by .999-SNAPSHOT as the version
export QUARKUS_VERSION="${{ inputs.quarkus-version }}.999-SNAPSHOT"
elif ! $(expr match "$QUARKUS_VERSION" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
elif ! $(echo "$QUARKUS_VERSION" | grep -q "\-SNAPSHOT$") && ! $(expr match "$QUARKUS_VERSION" "^.*\.\(Final\|CR\|Alpha\|Beta\)[0-9]\?$" > /dev/null)
then
export QUARKUS_VERSION="999-SNAPSHOT"
fi
Expand Down
Loading