Skip to content

Commit fb747e2

Browse files
committed
Add outputs to build-graalvm workflow.
1 parent 22a74d0 commit fb747e2

File tree

6 files changed

+50
-34
lines changed

6 files changed

+50
-34
lines changed

.github/workflows/build-graalvm.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ description: 'Build GraalVM and set up environment for testing'
4545
on:
4646
workflow_call:
4747
inputs:
48-
env:
49-
description: 'Internal env name for build'
50-
required: false
51-
type: string
5248
dynamic-imports:
5349
default: '/substratevm'
5450
description: 'Internal dynamic imports for build'
@@ -64,6 +60,16 @@ on:
6460
description: 'Internal GraalVM components to build'
6561
required: false
6662
type: string
63+
outputs:
64+
graalvm-home:
65+
description: "The path of the archived GRAALVM_HOME directory"
66+
value: ${{ jobs.build_from_source.outputs.graalvm-home }}
67+
graalvm-artifact-name:
68+
description: "The name of the GraalVM artifact"
69+
value: ${{ jobs.build_from_source.outputs.graalvm-graalvm-artifact-name }}
70+
graalvm-artifact-file-name:
71+
description: "The file name of the GraalVM artifact"
72+
value: ${{ jobs.build_from_source.outputs.graalvm-graalvm-artifact-file-name }}
6773
# Enable manual dispatch of the workflow
6874
# see https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
6975
workflow_dispatch:
@@ -72,6 +78,9 @@ jobs:
7278
build_from_source:
7379
name: Build GraalVM
7480
runs-on: ubuntu-22.04
81+
outputs:
82+
graalvm-home: ${{ steps.set_outputs.outputs.graalvm-home }}
83+
graalvm-artifact-name: ${{ steps.set_outputs.outputs.graalvm-artifact-name }}
7584
steps:
7685
- name: Checkout oracle/graal
7786
uses: actions/checkout@v4
@@ -86,6 +95,13 @@ jobs:
8695
echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV}
8796
# Workaround testsuite locale issue
8897
echo "LANG=en_US.UTF-8" >> ${GITHUB_ENV}
98+
- name: Set workflow outputs
99+
id: set_outputs
100+
shell: bash
101+
run: |
102+
echo "graalvm-home=$(basename ${GRAALVM_HOME})" >> $GITHUB_OUTPUT
103+
echo "graalvm-artifact-name=graalvm" >> $GITHUB_OUTPUT
104+
echo "graalvm-artifact-file-name=graalvm.tgz" >> $GITHUB_OUTPUT
89105
- name: Checkout graalvm/mx
90106
uses: actions/checkout@v6
91107
with:
@@ -105,16 +121,12 @@ jobs:
105121
shell: bash
106122
run: |
107123
cd vm
108-
MX_ARGS=("--java-home" "${JAVA_HOME}")
109-
if [ -n "${{ inputs.env }}" ]; then
110-
MX_ARGS+=("--env" "${{ inputs.env }}")
111-
else
112-
MX_ARGS+=(
113-
"--dy" "${{ inputs.dynamic-imports }}"
114-
"--native-images=${{ inputs.native-images }}"
115-
"--components=${{ inputs.components }}"
116-
)
117-
fi
124+
MX_ARGS=(
125+
"--java-home" "${JAVA_HOME}"
126+
"--dy" "${{ inputs.dynamic-imports }}"
127+
"--native-images=${{ inputs.native-images }}"
128+
"--components=${{ inputs.components }}"
129+
)
118130
${MX_PATH}/mx "${MX_ARGS[@]}" build
119131
ln -s $(${MX_PATH}/mx "${MX_ARGS[@]}" graalvm-home) ${GRAALVM_HOME}
120132
- name: Show GraalVM version info
@@ -135,6 +147,6 @@ jobs:
135147
- name: Upload GraalVM archive as artifact
136148
uses: actions/upload-artifact@v4
137149
with:
138-
name: graalvm
139-
path: graalvm.tgz
150+
name: ${{ steps.set_outputs.outputs.graalvm-artifact-name }}
151+
path: ${{ steps.set_outputs.outputs.graalvm-artifact-file-name }}
140152

.github/workflows/micronaut-template.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ on:
4848
type: string
4949

5050
env:
51-
JAVA_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/workflows/build-graalvm
5251
MICRONAUT_CORE_PATH: ${{ github.workspace }}/micronaut-core
5352
MICRONAUT_JAVA_VERSION: 25
5453
# Enforce experimental option checking in CI (GR-47922)
@@ -72,9 +71,11 @@ jobs:
7271
- name: Download GraalVM build
7372
uses: actions/download-artifact@v5
7473
with:
75-
name: 'graalvm'
74+
name: ${{ needs.build-graalvm.outputs.graalvm-artifact-name }}
7675
- name: Extract GraalVM build and use it as JAVA_HOME
77-
run: tar -xzvf graalvm.tgz -C $(dirname ${JAVA_HOME})
76+
run: |
77+
tar -xzvf ${{ needs.build-graalvm.outputs.graalvm-artifact-file-name }} -C $(dirname "${{ needs.build-graalvm.outputs.graalvm-home }}")
78+
echo "JAVA_HOME=${{ needs.build-graalvm.outputs.graalvm-home }}" >> ${GITHUB_ENV}
7879
- name: Run nativeTest in Micronaut launch project
7980
run: |
8081
curl --fail --silent --location --retry 3 --max-time 10 --output demo.zip --request GET 'https://launch.micronaut.io/create/default/com.example.demo?lang=JAVA&build=GRADLE&test=JUNIT&javaVersion=JDK_${{ env.MICRONAUT_JAVA_VERSION }}'

.github/workflows/ni-layers.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,17 @@ jobs:
9999
- name: Checkout oracle/graal
100100
uses: actions/checkout@v4
101101
- name: Download GraalVM build
102-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
102+
uses: actions/download-artifact@v5
103103
with:
104-
name: graalvm
105-
path: .
104+
name: ${{ needs.build-graalvm.outputs.graalvm-artifact-name }}
106105
- name: Extract GraalVM build
107-
run: tar -xzvf graalvm.tgz -C $(dirname ${GRAALVM_HOME})
106+
run: |
107+
tar -xzvf ${{ needs.build-graalvm.outputs.graalvm-artifact-file-name }} -C $(dirname "${{ needs.build-graalvm.outputs.graalvm-home }}")
108+
echo "GRAALVM_HOME=${{ needs.build-graalvm.outputs.graalvm-home }}" >> ${GITHUB_ENV}
108109
- name: Setup python
109110
uses: actions/setup-python@v5
110111
with:
111112
python-version: '${{ env.PYTHON_VERSION }}'
112113
- name: Build layer
113114
run: |
114-
python3 ${{ env.LIBRARY_METADATA_PATH }}/build_native_image_layer.py ${{ env.GRAALVM_HOME }}/bin/native-image "${{ matrix.coordinates }}"
115+
python3 ${{ env.LIBRARY_METADATA_PATH }}/build_native_image_layer.py $GRAALVM_HOME/bin/native-image "${{ matrix.coordinates }}"

.github/workflows/quarkus-template.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ jobs:
113113
name: Native Tests - ${{matrix.category}}${{ inputs.NATIVE_IMAGE_OPTIONS && format(' with ''{0}''', inputs.NATIVE_IMAGE_OPTIONS) || '' }}
114114
needs: [build-graalvm, build-quarkus]
115115
runs-on: ubuntu-latest
116-
env:
117-
GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/workflows/build-graalvm
118116
# Ignore the following YAML Schema error
119117
timeout-minutes: ${{matrix.timeout}}
120118
strategy:
@@ -126,11 +124,13 @@ jobs:
126124
if: startsWith(matrix.os-name, 'ubuntu')
127125
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
128126
with:
129-
name: graalvm
127+
name: ${{ needs.build-graalvm.outputs.graalvm-artifact-name }}
130128
- name: Extract GraalVM build
131129
if: startsWith(matrix.os-name, 'ubuntu')
132130
shell: bash
133-
run: tar -xzvf graalvm.tgz -C $(dirname ${GRAALVM_HOME})
131+
run: |
132+
tar -xzvf ${{ needs.build-graalvm.outputs.graalvm-artifact-file-name }} -C $(dirname "${{ needs.build-graalvm.outputs.graalvm-home }}")
133+
echo "GRAALVM_HOME=${{ needs.build-graalvm.outputs.graalvm-home }}" >> ${GITHUB_ENV}
134134
- name: Get latest Quarkus release
135135
if: startsWith(matrix.os-name, 'ubuntu')
136136
run: |

.github/workflows/reachability-metadata-template.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ jobs:
8888
test-all-metadata:
8989
name: ${{ matrix.coordinates }}
9090
runs-on: ubuntu-latest
91-
env:
92-
JAVA_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/workflows/build-graalvm
9391
timeout-minutes: 20
9492
needs: [build-graalvm, populate-matrix]
9593
strategy:
@@ -104,9 +102,11 @@ jobs:
104102
- name: Download GraalVM
105103
uses: actions/download-artifact@v5
106104
with:
107-
name: 'graalvm'
105+
name: ${{ needs.build-graalvm.outputs.graalvm-artifact-name }}
108106
- name: Extract GraalVM build and use it as JAVA_HOME
109-
run: tar -xzvf graalvm.tgz -C $(dirname ${JAVA_HOME})
107+
run: |
108+
tar -xzvf ${{ needs.build-graalvm.outputs.graalvm-artifact-file-name }} -C $(dirname "${{ needs.build-graalvm.outputs.graalvm-home }}")
109+
echo "JAVA_HOME=${{ needs.build-graalvm.outputs.graalvm-home }}" >> ${GITHUB_ENV}
110110
- name: "Pull allowed docker images"
111111
run: |
112112
./gradlew pullAllowedDockerImages --coordinates=${{ matrix.coordinates }}

.github/workflows/spring-template.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ jobs:
6969
- name: Download GraalVM
7070
uses: actions/download-artifact@v5
7171
with:
72-
name: 'graalvm'
72+
name: ${{ needs.build-graalvm.outputs.graalvm-artifact-name }}
7373
- name: Extract GraalVM build and use it as JAVA_HOME
74-
run: tar -xzvf graalvm.tgz -C $(dirname ${JAVA_HOME})
74+
run: |
75+
tar -xzvf ${{ needs.build-graalvm.outputs.graalvm-artifact-file-name }} -C $(dirname "${{ needs.build-graalvm.outputs.graalvm-home }}")
76+
echo "JAVA_HOME=${{ needs.build-graalvm.outputs.graalvm-home }}" >> ${GITHUB_ENV}
7577
- name: Checkout spring-projects/spring-petclinic
7678
uses: actions/checkout@v4
7779
with:

0 commit comments

Comments
 (0)