Skip to content

Commit

Permalink
4.x: Upgrade github actions to v4 (#1037)
Browse files Browse the repository at this point in the history
* Upgrade github actions to v4
* unique artifacts to fix upgrade to v4
* Use setup-graalvm@v1.2.1
* Use upload-artifact/merge to create aggregated artifacts

---------

Co-authored-by: Romain Grecourt <romain.grecourt@oracle.com>
  • Loading branch information
barchetta and romain-grecourt committed Apr 25, 2024
1 parent ad9c489 commit fd0d06f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 32 deletions.
28 changes: 14 additions & 14 deletions .github/actions/common/action.yml
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.
Expand Down Expand Up @@ -56,10 +56,10 @@ 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)
test-artifact-name:
description: Name of the test artifact to create (excluded on windows), if non empty tests are archived
required: false
default: 'false'
default: ''
test-matrix:
description: |
A JSON matrix with a "group" dimension, and a "groups" object to resolve Maven modules
Expand Down Expand Up @@ -109,21 +109,21 @@ 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/setup-graalvm@v1.2.1
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:
path: |
.m2/repository/**
Expand All @@ -134,7 +134,7 @@ runs:
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/**
Expand All @@ -145,7 +145,7 @@ runs:
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/**
Expand All @@ -157,7 +157,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/**
Expand Down Expand Up @@ -191,18 +191,18 @@ runs:
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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ jobs:
outputs:
tag: ${{ steps.create-tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
- 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 }}
Expand All @@ -61,7 +61,7 @@ jobs:
timeout-minutes: 30
environment: release
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ needs.create-tag.outputs.tag }}
- uses: ./.github/actions/common
Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/validate.yml
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.
Expand Down Expand Up @@ -37,15 +37,15 @@ env:
-Djdk.toolchain.version=${JAVA_VERSION}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
copyright:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
Expand All @@ -56,7 +56,7 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
Expand All @@ -66,7 +66,7 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
Expand All @@ -78,15 +78,15 @@ jobs:
outputs:
test-matrix: ${{ steps.build.outputs.test-matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- id: build
uses: ./.github/actions/common
with:
build-cache: read-write
maven-cache: read-write
artifact-name: helidon-cli
artifact-name: helidon-cli-dist
artifact-path: cli/impl/target/helidon-cli.zip
run: |
mvn ${MAVEN_ARGS} -T 8 \
Expand Down Expand Up @@ -116,13 +116,13 @@ jobs:
runs-on: ${{ matrix.os }}
name: tests/${{ matrix.group }}-${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-only
archive-test-results: true
test-artifact-name: tests-${{ matrix.group }}-${{ matrix.platform }}
run: |
mvn ${MAVEN_ARGS} \
-pl ${{ matrix.modules }} \
Expand All @@ -134,7 +134,7 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
Expand All @@ -150,7 +150,7 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
Expand All @@ -166,7 +166,7 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
Expand Down Expand Up @@ -195,15 +195,15 @@ jobs:
runs-on: ${{ matrix.os }}
name: cli/${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-only
native-image: true
archive-test-results: true
artifact-name: helidon-cli
test-artifact-name: helidon-cli-smoketest-${{ matrix.platform }}
artifact-name: helidon-cli-bin-${{ matrix.platform }}
artifact-path: cli/impl/target/helidon-cli-${{ matrix.platform }}${{ matrix.file-ext }}
run: |
# build the executable
Expand All @@ -222,3 +222,19 @@ jobs:
-Dsurefire.reportNameSuffix=native-image-${{ matrix.platform }} \
-Dtest=CliFunctionalV2Test#*Native* \
test
cli-binaries:
runs-on: ubuntu-20.04
needs: [ build, cli ]
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: helidon-cli
pattern: "helidon-cli-{bin-*,dist}"
test-results:
runs-on: ubuntu-20.04
needs: [ tests, cli ]
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: test-results
pattern: "*test*"

0 comments on commit fd0d06f

Please sign in to comment.