From 712747289753cc5e2aba67eef052cd764b2e1ed9 Mon Sep 17 00:00:00 2001 From: Thibault Vallin Date: Sat, 18 Jan 2025 00:12:06 +0100 Subject: [PATCH] Upload tests result artifact on Windows (#1099) * Upload tests result artifacts on Windows * Rename MAVEN_ARGS to MVN_ARGS to fix windows issues with Maven 3.9.9 * Fix build-cache-maven-extension it/test3 * Fix copyright --------- Co-authored-by: Romain Grecourt --- .github/actions/common/action.yml | 11 +++++----- .github/workflows/release.yml | 4 ++-- .github/workflows/validate.yml | 22 +++++++++---------- etc/scripts/checkstyle.sh | 4 ++-- etc/scripts/copyright.sh | 4 ++-- etc/scripts/release.sh | 12 +++++----- .../src/it/projects/test3/invoker.properties | 4 ++-- 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/.github/actions/common/action.yml b/.github/actions/common/action.yml index 1ee8abeb0..d54399eeb 100644 --- a/.github/actions/common/action.yml +++ b/.github/actions/common/action.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. +# Copyright (c) 2023, 2025 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. @@ -57,7 +57,7 @@ inputs: required: false default: '' test-artifact-name: - description: Name of the test artifact to create (excluded on windows), if non empty tests are archived + description: Name of the test artifact to create, if non empty tests are archived required: false default: '' free-space: @@ -150,15 +150,14 @@ runs: GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }} GPG_PRIVATE_KEY: ${{ inputs.GPG_PRIVATE_KEY }} MAVEN_SETTINGS: ${{ inputs.MAVEN_SETTINGS }} - MAVEN_ARGS: | - ${{ env.MAVEN_ARGS }} + MVN_ARGS: | + ${{ env.MVN_ARGS }} -Dmaven.repo.local=${{ github.workspace }}/.m2/repository -Dcache.record=${{ inputs.build-cache == 'read-write' }} run: ${{ inputs.run }} shell: bash - name: Archive test results - # https://github.com/actions/upload-artifact/issues/240 - if: ${{ inputs.test-artifact-name != '' && runner.os != 'Windows' && always() }} + if: ${{ inputs.test-artifact-name != '' && always() }} uses: actions/upload-artifact@v4 with: if-no-files-found: 'ignore' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60011aee4..c5b245cbc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. +# Copyright (c) 2023, 2025 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. @@ -23,7 +23,7 @@ on: env: JAVA_VERSION: 17 JAVA_DISTRO: oracle - MAVEN_ARGS: | + MVN_ARGS: | -B -e -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index cddf5a980..13a322b9b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. +# Copyright (c) 2023, 2025 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. @@ -30,7 +30,7 @@ env: JAVA_VERSION: 17 JAVA_DISTRO: oracle GRAALVM_VERSION: 21.3.3.1 - MAVEN_ARGS: | + MVN_ARGS: | -B -fae -e -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3 @@ -90,8 +90,8 @@ jobs: artifact-path: cli/impl/target/helidon-cli.zip run: | mvn --version - mvn ${MAVEN_ARGS} build-cache:go-offline - mvn ${MAVEN_ARGS} -T8 \ + mvn ${MVN_ARGS} build-cache:go-offline + mvn ${MVN_ARGS} -T8 \ -Dorg.slf4j.simpleLogger.showThreadName=true \ -DskipTests \ -P tests \ @@ -115,9 +115,9 @@ jobs: - uses: ./.github/actions/common with: build-cache: read-only - test-artifact-name: tests-${{ matrix.moduleSet }} + test-artifact-name: tests-${{ matrix.moduleSet }}-${{ matrix.os }} run: | - mvn ${MAVEN_ARGS} \ + mvn ${MVN_ARGS} \ -DreactorRule=tests \ -DmoduleSet=${{ matrix.moduleSet }} \ -Dsurefire.reportNameSuffix=${{ matrix.platform }} \ @@ -134,7 +134,7 @@ jobs: with: build-cache: read-only run: | - mvn ${MAVEN_ARGS} -T 8 \ + mvn ${MVN_ARGS} -T 8 \ -DskipTests \ -Pspotbugs,build-cache \ verify @@ -150,7 +150,7 @@ jobs: with: build-cache: read-only run: | - mvn ${MAVEN_ARGS} -T 8 \ + mvn ${MVN_ARGS} -T 8 \ -DskipTests \ -Pjavadoc,build-cache \ package @@ -166,7 +166,7 @@ jobs: with: build-cache: read-write run: | - mvn ${MAVEN_ARGS} \ + mvn ${MVN_ARGS} \ -pl ide-support/vscode-extension \ -DskipTests \ -P vscode \ @@ -196,7 +196,7 @@ jobs: artifact-path: cli/impl/target/helidon-cli-${{ matrix.platform }}${{ matrix.file-ext }} run: | # build the executable - mvn ${MAVEN_ARGS} \ + mvn ${MVN_ARGS} \ -pl cli/impl \ -DskipTests \ -Pnative-image,!toolchain \ @@ -204,7 +204,7 @@ jobs: package # smoke test - mvn ${MAVEN_ARGS} \ + mvn ${MVN_ARGS} \ -pl cli/tests/functional \ -Pnative-image \ -Dnative.image.name=helidon-cli-${{ matrix.platform }} \ diff --git a/etc/scripts/checkstyle.sh b/etc/scripts/checkstyle.sh index ee5c8e158..fafa1434b 100755 --- a/etc/scripts/checkstyle.sh +++ b/etc/scripts/checkstyle.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2023 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 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. @@ -53,7 +53,7 @@ die(){ echo "${1}" ; exit 1 ;} rm -f "${WS_DIR}"/target/checkstyle-* # shellcheck disable=SC2086 -mvn ${MAVEN_ARGS} checkstyle:checkstyle-aggregate \ +mvn ${MVN_ARGS} checkstyle:checkstyle-aggregate \ -f "${WS_DIR}"/pom.xml \ -Dcheckstyle.output.format="plain" \ -Dcheckstyle.output.file="${RESULT_FILE}" \ diff --git a/etc/scripts/copyright.sh b/etc/scripts/copyright.sh index 6f9956d10..6e55fa96a 100755 --- a/etc/scripts/copyright.sh +++ b/etc/scripts/copyright.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2023 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 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. @@ -49,7 +49,7 @@ readonly RESULT_FILE die() { echo "${1}" ; exit 1 ;} # shellcheck disable=SC2086 -mvn ${MAVEN_ARGS} \ +mvn ${MVN_ARGS} \ -f ${WS_DIR}/pom.xml \ -Dhelidon.enforcer.output.file="${RESULT_FILE}" \ -Dhelidon.enforcer.rules=copyright \ diff --git a/etc/scripts/release.sh b/etc/scripts/release.sh index 58a0e953c..624e0215f 100755 --- a/etc/scripts/release.sh +++ b/etc/scripts/release.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2023 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 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. @@ -109,7 +109,7 @@ exec 6>&1 1>&2 current_version() { # shellcheck disable=SC2086 - mvn ${MAVEN_ARGS} -q \ + mvn ${MVN_ARGS} -q \ -f "${WS_DIR}"/pom.xml \ -Dexec.executable="echo" \ -Dexec.args="\${project.version}" \ @@ -133,7 +133,7 @@ update_version(){ fi # shellcheck disable=SC2086 - mvn ${MAVEN_ARGS} "${ARGS[@]}" \ + mvn ${MVN_ARGS} "${ARGS[@]}" \ -f "${WS_DIR}"/pom.xml versions:set versions:set-property \ -DgenerateBackupPoms="false" \ -DnewVersion="${version}" \ @@ -176,7 +176,7 @@ release_build(){ if [ -n "${MAVEN_SETTINGS}" ] ; then tmpfile=$(mktemp XXXXXXsettings.xml) echo "${MAVEN_SETTINGS}" > "${tmpfile}" - MAVEN_ARGS="${MAVEN_ARGS} -s ${tmpfile}" + MVN_ARGS="${MVN_ARGS} -s ${tmpfile}" fi if [ -n "${GPG_PRIVATE_KEY}" ] ; then tmpfile=$(mktemp XXXXXX.key) @@ -193,7 +193,7 @@ release_build(){ # Perform local deployment # shellcheck disable=SC2086 - mvn ${MAVEN_ARGS} "${ARGS[@]}" \ + mvn ${MVN_ARGS} "${ARGS[@]}" \ deploy \ -Prelease \ -DskipTests \ @@ -202,7 +202,7 @@ release_build(){ # Upload all artifacts to nexus version=$(release_version) # shellcheck disable=SC2086 - mvn ${MAVEN_ARGS} -N nexus-staging:deploy-staged \ + mvn ${MVN_ARGS} -N nexus-staging:deploy-staged \ -DstagingDescription="Helidon Build Tools v${version}" } diff --git a/maven-plugins/build-cache-maven-extension/src/it/projects/test3/invoker.properties b/maven-plugins/build-cache-maven-extension/src/it/projects/test3/invoker.properties index 54fcba5d2..01593da41 100644 --- a/maven-plugins/build-cache-maven-extension/src/it/projects/test3/invoker.properties +++ b/maven-plugins/build-cache-maven-extension/src/it/projects/test3/invoker.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2024 Oracle and/or its affiliates. +# Copyright (c) 2024, 2025 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. @@ -24,4 +24,4 @@ invoker.goals.2 = package -DskipTests -Pjavadoc invoker.name.3 = Cached build #2 invoker.description.3 = Tests resumed deploy -invoker.goals.3 = deploy -DaltDeploymentRepository=":::file://${maven.multiModuleProjectDirectory}/staging" +invoker.goals.3 = deploy -DaltDeploymentRepository="local::file://${maven.multiModuleProjectDirectory}/staging"