Skip to content

Commit 0d566c9

Browse files
committed
Add weekly workflow for reachability metadata.
1 parent 66c5f66 commit 0d566c9

File tree

2 files changed

+153
-2
lines changed

2 files changed

+153
-2
lines changed

.github/actions/build-graalvm/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ name: Build GraalVM JDK
22
description: 'Build GraalVM JDK and set up environment for testing'
33

44
inputs:
5+
native-images:
6+
description: 'Selected internal GraalVM native images to build'
7+
required: false
8+
default: 'native-image'
9+
components:
10+
description: 'Selected internal GraalVM components to build'
11+
required: false
12+
default: 'Native Image'
513
java-version:
614
description: 'Java version to use'
715
required: false
@@ -47,8 +55,8 @@ runs:
4755
shell: bash
4856
run: |
4957
cd substratevm
50-
${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native=native-image --components="Native Image" build
51-
ln -s $(${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native=native-image --components="Native Image" graalvm-home) ${GRAALVM_HOME}
58+
${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native-images="${{ inputs.native-images }}" --components="${{ inputs.components }}" build
59+
ln -s $(${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native-images="${{ inputs.native-images }}" --components="${{ inputs.components }}" graalvm-home) ${GRAALVM_HOME}
5260
${GRAALVM_HOME}/bin/native-image --version
5361
- name: Set up JAVA_HOME
5462
if: ${{ inputs.java-version }} != ''
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#
2+
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# The Universal Permissive License (UPL), Version 1.0
6+
#
7+
# Subject to the condition set forth below, permission is hereby granted to any
8+
# person obtaining a copy of this software, associated documentation and/or
9+
# data (collectively the "Software"), free of charge and under any and all
10+
# copyright rights in the Software, and any and all patent rights owned or
11+
# freely licensable by each licensor hereunder covering either (i) the
12+
# unmodified Software as contributed to or provided by such licensor, or (ii)
13+
# the Larger Works (as defined below), to deal in both
14+
#
15+
# (a) the Software, and
16+
#
17+
# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
# one is included with the Software each a "Larger Work" to which the Software
19+
# is contributed by such licensors),
20+
#
21+
# without restriction, including without limitation the rights to copy, create
22+
# derivative works of, display, perform, and distribute the Software and make,
23+
# use, sell, offer for sale, import, export, have made, and have sold the
24+
# Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
# either these or other terms.
26+
#
27+
# This license is subject to the following condition:
28+
#
29+
# The above copyright notice and either this complete permission notice or at a
30+
# minimum a reference to the UPL must be included in all copies or substantial
31+
# portions of the Software.
32+
#
33+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
# SOFTWARE.
40+
#
41+
name: Weekly Reachability Metadata Tests
42+
43+
on:
44+
push:
45+
paths:
46+
- '.github/workflows/reachability-metadata.yml'
47+
pull_request:
48+
paths:
49+
- '.github/workflows/reachability-metadata.yml'
50+
schedule:
51+
- cron: '0 1 * * 1'
52+
workflow_dispatch:
53+
54+
env:
55+
REACHABILITY_METADATA_PATH: ${{ github.workspace }}/graalvm-reachability-metadata
56+
MINIMUM_METADATA_JAVA_VERSION: 17
57+
58+
permissions:
59+
contents: read # to fetch code (actions/checkout)
60+
61+
jobs:
62+
build-graalvm-and-populate-matrix:
63+
name: Build GraalVM and populate matrix
64+
runs-on: ubuntu-20.04
65+
if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule')
66+
outputs:
67+
matrix: ${{ steps.set-matrix.outputs.matrix }}
68+
steps:
69+
- name: Checkout oracle/graal
70+
uses: actions/checkout@v4
71+
with:
72+
fetch-depth: 1
73+
- name: Build GraalVM JDK
74+
uses: ./.github/actions/build-graalvm
75+
with:
76+
native-images: 'native-image,native-image-configure,lib:native-image-agent'
77+
components: 'Native Image,Native Image Configure Tool'
78+
java-version: ${{ env.MINIMUM_METADATA_JAVA_VERSION }}
79+
- name: Tar GraalVM JDK
80+
shell: bash
81+
run: tar -czvhf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME})
82+
- name: Persist GraalVM JDK build
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: graalvm
86+
path: graalvm.tgz
87+
- name: Checkout oracle/graalvm-reachability-metadata
88+
uses: actions/checkout@v4
89+
with:
90+
repository: oracle/graalvm-reachability-metadata
91+
fetch-depth: 1
92+
path: ${{ env.REACHABILITY_METADATA_PATH }}
93+
- name: "Populate matrix"
94+
id: set-matrix
95+
run: |
96+
cd ${{ env.REACHABILITY_METADATA_PATH }}
97+
./gradlew generateMatrixMatchingCoordinates -Pcoordinates=all
98+
99+
test-all-metadata:
100+
name: ${{ matrix.coordinates }}
101+
runs-on: ubuntu-latest
102+
env:
103+
GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/actions/build-graalvm
104+
timeout-minutes: 20
105+
needs: build-graalvm-and-populate-matrix
106+
strategy:
107+
fail-fast: false
108+
matrix:
109+
coordinates: ${{fromJson(needs.build-graalvm-and-populate-matrix.outputs.matrix).coordinates}}
110+
steps:
111+
- name: Download GraalVM JDK build
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: graalvm
115+
path: .
116+
- name: Extract GraalVM JDK build
117+
run: tar -xzvf graalvm.tgz -C $(dirname ${GRAALVM_HOME})
118+
- name: "Setup JAVA_HOME"
119+
uses: actions/setup-java@v4
120+
with:
121+
distribution: 'oracle'
122+
java-version: ${{ env.MINIMUM_METADATA_JAVA_VERSION }}
123+
- name: "Checkout oracle/graalvm-reachability-metadata"
124+
uses: actions/checkout@v4
125+
with:
126+
repository: oracle/graalvm-reachability-metadata
127+
fetch-depth: 1
128+
- name: "Pull allowed docker images"
129+
run: |
130+
./gradlew pullAllowedDockerImages --coordinates=${{ matrix.coordinates }}
131+
- name: "Disable docker"
132+
run: |
133+
sudo apt-get install openbsd-inetd
134+
sudo bash -c "cat ./.github/workflows/discard-port.conf >> /etc/inetd.conf"
135+
sudo systemctl start inetd
136+
sudo mkdir /etc/systemd/system/docker.service.d
137+
sudo bash -c "cat ./.github/workflows/dockerd.service > /etc/systemd/system/docker.service.d/http-proxy.conf"
138+
sudo systemctl daemon-reload
139+
sudo systemctl restart docker
140+
- name: "Run '${{ matrix.coordinates }}' tests"
141+
run: |
142+
./gradlew test -Pcoordinates=${{ matrix.coordinates }}
143+

0 commit comments

Comments
 (0)