Skip to content

[CI] Move build-quarkus to separate reusable workflow #319

[CI] Move build-quarkus to separate reusable workflow

[CI] Move build-quarkus to separate reusable workflow #319

Workflow file for this run

name: Windows Mandrel-Quarkus tests
on:
workflow_call:
inputs:
quarkus-version:
type: string
description: 'Quarkus version to test (branch, tag, commit, or "latest")'
# "latest" is replaced by the latest release available in maven
default: "main"
quarkus-repo:
type: string
description: 'The Quarkus repository to be used'
default: 'quarkusio/quarkus'
version:
type: string
description: 'Mandrel version to test (branch, tag, or commit)'
default: "graal/master"
repo:
type: string
description: 'The Mandrel/Graal repository to be used'
default: 'graalvm/mandrel'
mandrel-packaging-version:
type: string
description: 'Mandrel packaging version to test (branch, tag, or commit)'
default: "master"
mandrel-packaging-repo:
type: string
description: 'Mandrel packaging repository to be used'
default: "graalvm/mandrel-packaging"
build-type:
type: string
description: 'Build distribution (Mandrel/GraalVM) from source or grab a release'
default: "mandrel-source"
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)'
default: "17/ga"
# Builder image can't be tested on Windows due to https://github.com/actions/virtual-environments/issues/1143
# builder-image:
# description: 'The builder image to use instead of a release or building from source (e.g. quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11)'
# default: "null"
issue-number:
type: string
description: 'The issue number to report results to'
default: "null"
issue-repo:
type: string
description: 'The repository to report results to'
default: "graalvm/mandrel"
mandrel-it-issue-number:
type: string
description: 'The issue number to report results to mandrel-integration-tests'
default: "null"
build-stats-tag:
type: string
description: 'The tag to use for build stats upload of native tests (e.g. 22.3.0-dev-jdk17-mytest-patch-before)'
default: "null"
secrets:
ISSUE_BOT_TOKEN:
description: 'A token used to report results in GH issues'
required: false
UPLOAD_COLLECTOR_TOKEN:
description: 'A token used to report build statistics to a collector'
required: false
env:
# Workaround testsuite locale issue
LANG: en_US.UTF-8
DB_USER: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
DB_NAME: hibernate_orm_test
COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end"
NATIVE_TEST_MAVEN_OPTS: "-Dtest-containers -Dstart-containers -DfailIfNoTests=false -Dquarkus.native.native-image-xmx=13g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests -DskipDocs"
MX_GIT_CACHE: refcache
JAVA_HOME: ${{ github.workspace }}\openjdk
GRAALVM_HOME: ${{ github.workspace }}\graalvm-home
MANDREL_REPO: ${{ github.workspace }}\mandrel
MANDREL_HOME: ${{ github.workspace }}\..\mandrelvm
MX_PATH: ${{ github.workspace }}\mx
MX_PYTHON: python
QUARKUS_PATH: ${{ github.workspace }}\quarkus
MANDREL_PACKAGING_REPO: ${{ github.workspace }}\mandrel-packaging
COLLECTOR_URL: https://collector.foci.life/api/v1/image-stats
jobs:
build-vars:
name: Set distribution and build-from-source variables based on build-type
runs-on: ubuntu-latest
outputs:
build-from-source: ${{ steps.source-build.outputs.build-from-source }}
distribution: ${{ steps.distro.outputs.distribution }}
steps:
- name: Set build-from-source output
id: source-build
run: |
echo "${{ inputs.build-type }}"
bfs_token=$(echo ${{ inputs.build-type }} | cut -d'-' -f2)
if [ "${bfs_token}" == "release" ]
then
source_build=false
elif [ "${bfs_token}" == "source" ]
then
source_build=true
else
echo "Unexpected input 'build-type' = ${{ inputs.build-type }}"
exit 1
fi
echo "source_build=$source_build"
echo "build-from-source=$source_build" >> $GITHUB_OUTPUT
- name: Set distribution output
id: distro
run: |
bfs_token=$(echo ${{ inputs.build-type }} | cut -d'-' -f1)
if [ "${bfs_token}" == "graal" ]
then
distro="graalvm"
elif [ "${bfs_token}" == "mandrel" ]
then
distro="mandrel"
else
echo "Unexpected input 'build-type' = ${{ inputs.build-type }}"
exit 1
fi
echo "distro=$distro"
echo "distribution=$distro" >> $GITHUB_OUTPUT
get-test-matrix:
name: Get test matrix
runs-on: ubuntu-latest
outputs:
quarkus-version: ${{ steps.version.outputs.quarkus-version }}
tests-matrix: ${{ steps.version.outputs.tests-matrix }}
artifacts-suffix: ${{ steps.suffix.outputs.suffix }}
steps:
- id: suffix
run: |
export SUFFIX=$(echo '${{ toJson(inputs) }}' | jq -j '. | to_entries[] | "-\(.value)"' | tr '":<>|*?\\r\n\/' '-')
echo $SUFFIX
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
- 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 }}
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 }}
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=$(tr -d '\n' < native-tests.json)
echo ${tests_json}
echo "tests-matrix=${tests_json}" >> $GITHUB_OUTPUT
build-mandrel:
name: Mandrel build
runs-on: windows-2022
needs:
- get-test-matrix
- build-vars
if: fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'mandrel'
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
fetch-depth: 1
ref: ${{ inputs.version }}
path: ${{ env.MANDREL_REPO }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Checkout MX
run: |
VERSION=$(jq -r .mx_version ${MANDREL_REPO}/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} mx
./mx/mx --version
shell: bash
- uses: actions/checkout@v4
with:
repository: ${{ inputs.mandrel-packaging-repo }}
ref: ${{ inputs.mandrel-packaging-version }}
path: ${{ env.MANDREL_PACKAGING_REPO }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Get OpenJDK with static libs
run: |
$wc = New-Object System.Net.WebClient
$wc.DownloadFile("https://api.adoptium.net/v3/binary/latest/${{ inputs.jdk }}/windows/x64/jdk/hotspot/normal/eclipse", "$Env:temp\jdk.zip")
Expand-Archive "$Env:temp\jdk.zip" -DestinationPath "$Env:temp"
Move-Item -Path "$Env:temp\jdk-*" -Destination $Env:JAVA_HOME
$wc.DownloadFile("https://api.adoptium.net/v3/binary/latest/${{ inputs.jdk }}/windows/x64/staticlibs/hotspot/normal/eclipse", "$Env:temp\jdk-staticlibs.zip")
Expand-Archive "$Env:temp\jdk-staticlibs.zip" -DestinationPath "$Env:temp"
Move-Item -Path "$Env:temp\jdk-*\lib\static" -Destination $Env:JAVA_HOME\lib\
Remove-Item -Recurse "$Env:temp\jdk-*"
& $Env:JAVA_HOME\bin\java -version
- name: Build Mandrel
run: |
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars64.txt"
Get-Content "$Env:temp\vcvars64.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "Env:\$($matches[1])" $matches[2]
}
}
Set-Location -Path $Env:MANDREL_PACKAGING_REPO
& $Env:JAVA_HOME\bin\java -ea build.java `
--mx-home $Env:MX_PATH `
--mandrel-repo $Env:MANDREL_REPO `
--mandrel-home $Env:MANDREL_HOME
& $Env:MANDREL_HOME\bin\native-image --version
Remove-Item -Recurse $Env:JAVA_HOME
Move-Item -Path $Env:MANDREL_HOME -Destination $Env:JAVA_HOME
- name: Archive JDK
shell: bash
run: tar czvf jdk.tgz -C $(dirname ${JAVA_HOME}) $(basename ${JAVA_HOME})
- name: Persist Mandrel build
uses: actions/upload-artifact@v4
with:
name: win-jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: jdk.tgz
build-graal:
name: GraalVM CE build
runs-on: windows-2022
needs:
- get-test-matrix
- build-vars
if: fromJson(needs.build-vars.outputs.build-from-source) == true && needs.build-vars.outputs.distribution == 'graalvm'
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
fetch-depth: 1
ref: ${{ inputs.version }}
path: graal
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Checkout MX
run: |
VERSION=$(jq -r .mx_version graal/common.json)
git clone ${GITHUB_SERVER_URL}/graalvm/mx --depth 1 --branch ${VERSION} mx
./mx/mx --version
shell: bash
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Build graalvm native-image
run: |
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars64.txt"
Get-Content "$Env:temp\vcvars64.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "Env:\$($matches[1])" $matches[2]
}
}
Set-Location graal\substratevm
mkdir -p "$Env:temp\jdk-dl"
& $Env:MX_PATH\mx.cmd --java-home= fetch-jdk --java-distribution labsjdk-ce-$(("${{ inputs.jdk }}" -split "/")[0]) --to "$Env:temp\jdk-dl" --alias $Env:JAVA_HOME
& $Env:JAVA_HOME\bin\java --version
& $Env:MX_PATH\mx.cmd --native=native-image,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent --components="Native Image,LibGraal,svml" build
${graalvm-home} = @(& $Env:MX_PATH\mx.cmd --native=native-image,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent --components="Native Image,LibGraal,svml" graalvm-home)
rm -Recurse -Force $Env:JAVA_HOME
mv ${graalvm-home} $Env:JAVA_HOME
& $Env:JAVA_HOME\bin\native-image --version
- name: Archive JDK
shell: bash
run: tar czvf jdk.tgz -C $(dirname ${JAVA_HOME}) $(basename ${JAVA_HOME})
- name: Persist GraalVM CE build
uses: actions/upload-artifact@v4
with:
name: win-jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: jdk.tgz
get-jdk:
name: Get JDK ${{ inputs.jdk }}
runs-on: windows-2022
needs:
- get-test-matrix
- build-vars
if: fromJson(needs.build-vars.outputs.build-from-source) == false
steps:
- name: Get Mandrel ${{ inputs.version }}
if: needs.build-vars.outputs.distribution == 'mandrel'
run: |
$VERSION="${{ inputs.version }}"
$VERSION_SHORT=@($VERSION -replace 'mandrel-')
$wc = New-Object System.Net.WebClient
$url="$Env:GITHUB_SERVER_URL/graalvm/mandrel/releases/download/${VERSION}/mandrel-java$(("${{ inputs.jdk }}" -split "/")[0])-windows-amd64-${VERSION_SHORT}.zip"
$wc.DownloadFile($($url), "mandrel.zip")
Expand-Archive "mandrel.zip" -DestinationPath "$Env:temp"
Move-Item -Path "$Env:temp\mandrel-*" -Destination $Env:JAVA_HOME
& $Env:JAVA_HOME\bin\native-image --version
- name: Get GraalVM CE ${{ inputs.version }}
if: needs.build-vars.outputs.distribution == 'graalvm'
run: |
$VERSION="${{ inputs.version }}"
$VERSION_SHORT=@($VERSION -replace 'vm-')
$wc = New-Object System.Net.WebClient
$url="$Env:GITHUB_SERVER_URL/graalvm/graalvm-ce-builds/releases/download/${VERSION}/graalvm-ce-java$(("${{ inputs.jdk }}" -split "/")[0])-windows-amd64-${VERSION_SHORT}.zip"
$wc.DownloadFile($($url), "graalvm.zip")
Expand-Archive "graalvm.zip" -DestinationPath "$Env:temp"
Move-Item -Path "$Env:temp\graalvm-*" -Destination $Env:JAVA_HOME
& $Env:JAVA_HOME\bin\gu install native-image
& $Env:JAVA_HOME\bin\native-image --version
- name: Archive JDK
shell: bash
run: tar czvf jdk.tgz -C $(dirname ${JAVA_HOME}) $(basename ${JAVA_HOME})
- name: Persist Mandrel or GraalVM
uses: actions/upload-artifact@v4
with:
name: win-jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: jdk.tgz
build-quarkus:
name: Quarkus build
runs-on: ubuntu-latest
needs:
- get-test-matrix
strategy:
fail-fast: false
steps:
- uses: .github/workflows/build-quarkus.yml
with:
artifacts-suffix: ${{ needs.get-test-matrix.outputs.artifacts-suffix }}
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 }}
native-tests:
name: Q IT ${{ matrix.category }}
needs:
- build-quarkus
- build-mandrel
- build-graal
- get-jdk
- get-test-matrix
if: always() && (needs.build-graal.result == 'success' || needs.build-mandrel.result == 'success' || needs.get-jdk.result == 'success') && needs.build-quarkus.result == 'success'
runs-on: windows-2022
env:
# leave more space for the actual native compilation and execution
MAVEN_OPTS: -Xmx1g
# USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM: false
# Ignore the following YAML Schema error
timeout-minutes: ${{matrix.timeout}}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-test-matrix.outputs.tests-matrix) }}
steps:
- name: Support longpaths on Windows
if: startsWith(matrix.os-name, 'windows')
run: git config --global core.longpaths true
- uses: actions/checkout@v4
if: startsWith(matrix.os-name, 'windows')
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-mandrel
- name: Download Maven Repo
if: startsWith(matrix.os-name, 'windows')
uses: actions/download-artifact@v4
with:
name: windows-maven-repo-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Maven Repo
if: startsWith(matrix.os-name, 'windows')
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- uses: actions/checkout@v4
if: startsWith(matrix.os-name, 'windows')
with:
repository: ${{ inputs.quarkus-repo }}
fetch-depth: 1
ref: ${{ needs.get-test-matrix.outputs.quarkus-version }}
path: ${{ env.QUARKUS_PATH }}
- uses: actions/cache@v4
if: startsWith(matrix.os-name, 'windows')
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
if: startsWith(matrix.os-name, 'windows')
with:
distribution: 'temurin'
java-version: '17'
- name: Download Mandrel or GraalVM
if: startsWith(matrix.os-name, 'windows')
uses: actions/download-artifact@v4
with:
name: win-jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Mandrel or GraalVM
if: startsWith(matrix.os-name, 'windows')
shell: bash
run: |
mkdir -p "${GRAALVM_HOME}"
tar -xzvf jdk.tgz -C graalvm-home --strip-components=1
${GRAALVM_HOME}/bin/java -version
# - name: Reclaim disk space
# shell: bash
# run: ${QUARKUS_PATH}/.github/ci-prerequisites.sh
# We do this so we can get better analytics for the downloaded version of the build images
- name: Update Docker Client User Agent
if: startsWith(matrix.os-name, 'windows')
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: Change quarkus.version for Quarkus 2.2 to make mandrel-integration-test not apply quarkus_main.patch
if: startsWith(matrix.os-name, 'windows')
# See https://github.com/Karm/mandrel-integration-tests/pull/64
shell: bash
run: |
if [ "${{ inputs.quarkus-version }}" == "2.2" ]
then
cd quarkus
bash ../workflow-mandrel/.github/update_quarkus_version.sh 2.2.999
fi
- name: Build with Maven
if: startsWith(matrix.os-name, 'windows')
env:
TEST_MODULES: ${{matrix.test-modules}}
CATEGORY: ${{matrix.category}}
run: |
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars64.txt"
Get-Content "$Env:temp\vcvars64.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "Env:\$($matches[1])" $matches[2]
}
}
cd $Env:QUARKUS_PATH
Write-Host "$Env:GRAALVM_HOME"
if (Test-Path "$Env:GRAALVM_HOME/bin/native-image" -PathType leaf) {
& "$Env:GRAALVM_HOME/bin/native-image" --version
}
$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
#} else {
# mvn -pl $do_modules "-Dquarkus.native.container-build=true" "-Dquarkus.native.builder-image=${{ inputs.builder-image }}" $opts package
#}
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -type d -name '*-reports' -o -wholename '*/build/reports/tests/functionalTest' | tar czvf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v4
if: failure()
with:
name: win-test-reports-native-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: 'test-reports.tgz'
- name: Collect build JSON stats
if: ${{ startsWith(matrix.os-name, 'windows') && inputs.build-stats-tag != 'null' }}
shell: bash
run: find . -name '*runner*.json' | tar czvf build-stats.tgz -T -
- name: Upload build JSON stats
if: ${{ startsWith(matrix.os-name, 'windows') && inputs.build-stats-tag != 'null' }}
uses: actions/upload-artifact@v4
with:
name: build-stats-${{matrix.category}}-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: 'build-stats.tgz'
native-tests-stats-upload:
name: Upload build stats to collector
if: always() && inputs.build-stats-tag != 'null' && github.event_name != 'pull_request' && needs.native-tests.result != 'skipped' && needs.native-tests.result != 'cancelled'
needs:
- native-tests
- get-test-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-test-matrix.outputs.tests-matrix) }}
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/native-tests-stats-upload.yml
if: startsWith(matrix.os-name, 'windows')
with:
artifacts-suffix: ${{ needs.get-test-matrix.outputs.artifacts-suffix }}
build-stats-tag: ${{ inputs.build-stats-tag }}
category: ${{ matrix.category }}
mandrel-integration-tests:
name: Q Mandrel IT
if: always() && (needs.build-mandrel.result == 'success' || needs.get-jdk.result == 'success') && needs.build-vars.outputs.distribution == 'mandrel'
needs:
- build-vars
- build-mandrel
- get-jdk
- build-quarkus
- get-test-matrix
runs-on: windows-2022
env:
# leave more space for the actual native compilation and execution
MAVEN_OPTS: -Xmx1g
# Don't perform performance checks since GH runners are not that stable
FAIL_ON_PERF_REGRESSION: false
# USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM: false
timeout-minutes: 40
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-mandrel
- uses: actions/checkout@v4
with:
repository: Karm/mandrel-integration-tests
fetch-depth: 1
- name: Download Maven Repo
uses: actions/download-artifact@v4
with:
name: windows-maven-repo-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzvf maven-repo.tgz -C ~
# Use Java 17 for Quarkus as it doesn't work with Java 21 yet
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Download Mandrel or GraalVM
uses: actions/download-artifact@v4
with:
name: win-jdk-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: .
- name: Extract Mandrel or GraalVM
shell: bash
run: |
mkdir -p "${GRAALVM_HOME}"
tar -xzvf jdk.tgz -C graalvm-home --strip-components=1
${GRAALVM_HOME}/bin/java -version
- 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 with Maven
run: |
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars64.txt"
Get-Content "$Env:temp\vcvars64.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "Env:\$($matches[1])" $matches[2]
}
}
$Env:PATH="$Env:GRAALVM_HOME\bin;$Env:PATH"
if (Test-Path "$Env:GRAALVM_HOME\bin\native-image.cmd" -PathType leaf) {
& "$Env:GRAALVM_HOME\bin\native-image" --version
} else {
Write-Host "Cannot find native-image tool. Quitting..."
exit 1
}
$QUARKUS_VERSION="${{ needs.get-test-matrix.outputs.quarkus-version }}"
# Don't use SNAPSHOT version for 2.2 and release tags
if ("${{ inputs.quarkus-version }}" -eq "2.2") {
$QUARKUS_VERSION="2.2.999"
} elseif (${{ 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]?$")) {
$QUARKUS_VERSION="999-SNAPSHOT"
}
Write-Host "$QUARKUS_VERSION"
mvn clean verify "-Dquarkus.native.native-image-xmx=5g" "-Dquarkus.version=$QUARKUS_VERSION" -Ptestsuite
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: tar czvf test-reports-mandrel-it.tgz ./testsuite/target/archived-logs/
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v4
if: failure()
with:
name: win-test-reports-mandrel-it-${{ needs.get-test-matrix.outputs.artifacts-suffix }}
path: 'test-reports-mandrel-it.tgz'