Compare commits

...

2 Commits

Author SHA1 Message Date
Fabio Niephaus
49e43a25ae Build simple web server. 2025-09-23 13:32:57 +02:00
Fabio Niephaus
83c82dcca9 Fix musl name 2025-09-23 13:30:36 +02:00
3 changed files with 439 additions and 442 deletions

View File

@@ -35,343 +35,343 @@ jobs:
env: env:
INPUT_GITHUB_TOKEN: ${{ github.token }} # for core.getInput() INPUT_GITHUB_TOKEN: ${{ github.token }} # for core.getInput()
test-action: # test-action:
name: GraalVM # name: GraalVM
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
env: # env:
# Skip builds that require a GDS token but have no access to one (e.g., secrets are unavailable in PR runs) # # Skip builds that require a GDS token but have no access to one (e.g., secrets are unavailable in PR runs)
PASSES_GDS_TOKEN_CHECK: ${{ !matrix.set-gds-token || secrets.GDS_TOKEN != '' }} # PASSES_GDS_TOKEN_CHECK: ${{ !matrix.set-gds-token || secrets.GDS_TOKEN != '' }}
strategy: # strategy:
matrix: # matrix:
java-version: ['25', '21', '17', '20', 'dev'] # java-version: ['25', '21', '17', '20', 'dev']
distribution: ['graalvm', 'graalvm-community'] # distribution: ['graalvm', 'graalvm-community']
os: [ # os: [
ubuntu-latest, # Linux on Intel # ubuntu-latest, # Linux on Intel
ubuntu-22.04-arm, # Linux on arm64 # ubuntu-22.04-arm, # Linux on arm64
macos-latest, # macOS on Apple silicon # macos-latest, # macOS on Apple silicon
macos-13, # macOS on Intel # macos-13, # macOS on Intel
windows-latest # windows-latest
] # ]
set-gds-token: [false] # set-gds-token: [false]
components: [''] # components: ['']
include: # include:
- java-version: 'latest-ea' # - java-version: 'latest-ea'
distribution: 'graalvm' # distribution: 'graalvm'
os: ubuntu-latest # os: ubuntu-latest
- java-version: '25-ea' # - java-version: '25-ea'
distribution: 'graalvm' # distribution: 'graalvm'
os: ubuntu-latest # os: ubuntu-latest
- java-version: '21' # - java-version: '21'
distribution: '' # distribution: ''
os: ubuntu-latest # os: ubuntu-latest
- java-version: 'dev' # - java-version: 'dev'
distribution: '' # distribution: ''
os: windows-latest # os: windows-latest
- java-version: '21' # - java-version: '21'
distribution: 'graalvm-community' # distribution: 'graalvm-community'
os: ubuntu-latest # os: ubuntu-latest
components: 'native-image' # should print a warning but not fail # components: 'native-image' # should print a warning but not fail
- java-version: '21.0.0' # test for GA version (see #63) # - java-version: '21.0.0' # test for GA version (see #63)
distribution: 'graalvm' # distribution: 'graalvm'
os: ubuntu-latest # os: ubuntu-latest
- java-version: '17' # - java-version: '17'
distribution: 'graalvm' # distribution: 'graalvm'
os: ubuntu-latest # os: ubuntu-latest
set-gds-token: true # set-gds-token: true
- java-version: '17.0.13' # - java-version: '17.0.13'
distribution: 'graalvm' # distribution: 'graalvm'
os: ubuntu-latest # os: ubuntu-latest
set-gds-token: true # set-gds-token: true
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
java-version: ${{ matrix.java-version }} # java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.distribution }} # distribution: ${{ matrix.distribution }}
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
components: ${{ matrix.components }} # components: ${{ matrix.components }}
gds-token: ${{ matrix.set-gds-token && secrets.GDS_TOKEN || '' }} # gds-token: ${{ matrix.set-gds-token && secrets.GDS_TOKEN || '' }}
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' }} # if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' }}
- name: Check environment # - name: Check environment
run: | # run: |
echo "GRAALVM_HOME: $GRAALVM_HOME" # echo "GRAALVM_HOME: $GRAALVM_HOME"
if [[ "${{ matrix.java-version }}" == "dev" ]]; then # if [[ "${{ matrix.java-version }}" == "dev" ]]; then
[[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12 # [[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12
else # else
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23 # [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23
fi # fi
echo "JAVA_HOME: $JAVA_HOME" # echo "JAVA_HOME: $JAVA_HOME"
java --version # java --version
java --version | grep "GraalVM" || exit 34 # java --version | grep "GraalVM" || exit 34
native-image --version # native-image --version
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os != 'Windows' }} # if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os != 'Windows' }}
- name: Check Windows environment # - name: Check Windows environment
run: | # run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME" # echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" # echo "JAVA_HOME: $env:JAVA_HOME"
java --version # java --version
native-image --version # native-image --version
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os == 'Windows' }} # if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os == 'Windows' }}
test-action-ce: # make sure the action works on a clean machine without building # test-action-ce: # make sure the action works on a clean machine without building
needs: test-action # needs: test-action
name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }} # name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
strategy: # strategy:
matrix: # matrix:
version: ['latest', 'dev'] # version: ['latest', 'dev']
java-version: ['17', '20'] # java-version: ['17', '20']
components: ['native-image'] # components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest] # os: [macos-latest, windows-latest, ubuntu-latest]
exclude: # exclude:
- version: 'latest' # - version: 'latest'
java-version: '20' # java-version: '20'
- version: 'dev' # - version: 'dev'
java-version: '19' # java-version: '19'
include: # include:
- version: '22.2.0' # for update notifications # - version: '22.2.0' # for update notifications
java-version: '17' # java-version: '17'
components: 'native-image' # components: 'native-image'
os: ubuntu-22.04 # os: ubuntu-22.04
- version: '21.2.0' # - version: '21.2.0'
java-version: '8' # for JDK 8 notification # java-version: '8' # for JDK 8 notification
components: 'native-image' # components: 'native-image'
os: ubuntu-latest # os: ubuntu-latest
- version: '22.3.1' # - version: '22.3.1'
java-version: '11' # for JDK 11 notification # java-version: '11' # for JDK 11 notification
components: 'native-image' # components: 'native-image'
os: macos-13 # os: macos-13
- version: '22.3.1' # - version: '22.3.1'
java-version: '17' # java-version: '17'
components: 'native-image' # components: 'native-image'
os: windows-2022 # os: windows-2022
- version: 'dev' # - version: 'dev'
java-version: 'dev' # java-version: 'dev'
components: 'native-image' # components: 'native-image'
os: ubuntu-latest # os: ubuntu-latest
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
version: ${{ matrix.version }} # version: ${{ matrix.version }}
java-version: ${{ matrix.java-version }} # java-version: ${{ matrix.java-version }}
components: ${{ matrix.components }} # components: ${{ matrix.components }}
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment # - name: Check environment
run: | # run: |
echo "GRAALVM_HOME: $GRAALVM_HOME" # echo "GRAALVM_HOME: $GRAALVM_HOME"
if [[ "${{ matrix.version }}" == "dev" ]] && [[ "${{ matrix.java-version }}" == "dev" ]]; then # if [[ "${{ matrix.version }}" == "dev" ]] && [[ "${{ matrix.java-version }}" == "dev" ]]; then
[[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12 # [[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12
else # else
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23 # [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23
fi # fi
echo "JAVA_HOME: $JAVA_HOME" # echo "JAVA_HOME: $JAVA_HOME"
java -version # java -version
java -version 2>&1 | grep "GraalVM" || exit 34 # java -version 2>&1 | grep "GraalVM" || exit 34
native-image --version # native-image --version
if [[ "${{ matrix.java-version }}" != "dev" ]]; then # if [[ "${{ matrix.java-version }}" != "dev" ]]; then
gu list # gu list
fi # fi
if: ${{ runner.os != 'Windows' }} # if: ${{ runner.os != 'Windows' }}
- name: Check Windows environment # - name: Check Windows environment
run: | # run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME" # echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" # echo "JAVA_HOME: $env:JAVA_HOME"
java -version # java -version
native-image --version # native-image --version
gu.cmd remove native-image # gu.cmd remove native-image
if: ${{ runner.os == 'Windows' }} # if: ${{ runner.os == 'Windows' }}
test-action-ee: # test-action-ee:
needs: test-action # needs: test-action
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }} # name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
if: github.event_name != 'pull_request' # if: github.event_name != 'pull_request'
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
env: # env:
# Skip builds that require a GDS token but have no access to one (e.g., secrets are unavailable in PR runs) # # Skip builds that require a GDS token but have no access to one (e.g., secrets are unavailable in PR runs)
PASSES_GDS_TOKEN_CHECK: ${{ secrets.GDS_TOKEN != '' }} # PASSES_GDS_TOKEN_CHECK: ${{ secrets.GDS_TOKEN != '' }}
strategy: # strategy:
matrix: # matrix:
version: ['latest'] # version: ['latest']
java-version: ['17'] # java-version: ['17']
components: ['native-image'] # components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest] # os: [macos-latest, windows-latest, ubuntu-latest]
include: # include:
- version: '22.3.3' # - version: '22.3.3'
java-version: '11' # java-version: '11'
components: 'native-image' # components: 'native-image'
os: ubuntu-latest # os: ubuntu-latest
- version: '22.3.3' # - version: '22.3.3'
java-version: '17' # java-version: '17'
components: 'native-image' # components: 'native-image'
os: ubuntu-latest # os: ubuntu-latest
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
version: ${{ matrix.version }} # version: ${{ matrix.version }}
gds-token: ${{ secrets.GDS_TOKEN }} # gds-token: ${{ secrets.GDS_TOKEN }}
java-version: ${{ matrix.java-version }} # java-version: ${{ matrix.java-version }}
components: ${{ matrix.components }} # components: ${{ matrix.components }}
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' }} # if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' }}
- name: Check environment # - name: Check environment
run: | # run: |
echo "GRAALVM_HOME: $GRAALVM_HOME" # echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12 # [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME" # echo "JAVA_HOME: $JAVA_HOME"
java --version # java --version
java --version | grep -e "GraalVM EE" -e "Oracle GraalVM" || exit 23 # java --version | grep -e "GraalVM EE" -e "Oracle GraalVM" || exit 23
native-image --version # native-image --version
gu list # gu list
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os != 'Windows' }} # if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os != 'Windows' }}
- name: Check Windows environment # - name: Check Windows environment
run: | # run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME" # echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" # echo "JAVA_HOME: $env:JAVA_HOME"
java --version # java --version
native-image --version # native-image --version
gu.cmd remove native-image # gu.cmd remove native-image
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os == 'Windows' }} # if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os == 'Windows' }}
test-action-mandrel: # test-action-mandrel:
needs: test-action # needs: test-action
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }} # name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
strategy: # strategy:
matrix: # matrix:
version: ['mandrel-22.2.0.0-Final', '23.0.1.2-Final', 'mandrel-latest'] # version: ['mandrel-22.2.0.0-Final', '23.0.1.2-Final', 'mandrel-latest']
java-version: ['17'] # java-version: ['17']
distribution: ['mandrel'] # distribution: ['mandrel']
os: [windows-latest, ubuntu-latest] # os: [windows-latest, ubuntu-latest]
include: # include:
- version: 'mandrel-latest' # - version: 'mandrel-latest'
java-version: '17' # java-version: '17'
distribution: '' # test empty distribution for backward compatibility # distribution: '' # test empty distribution for backward compatibility
os: ubuntu-latest # os: ubuntu-latest
- version: '' # test with no version # - version: '' # test with no version
java-version: '21' # java-version: '21'
distribution: 'mandrel' # distribution: 'mandrel'
os: ubuntu-latest # os: ubuntu-latest
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
version: ${{ matrix.version }} # version: ${{ matrix.version }}
distribution: ${{ matrix.distribution }} # distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }} # java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment # - name: Check environment
run: | # run: |
echo "GRAALVM_HOME: $GRAALVM_HOME" # echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12 # [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME" # echo "JAVA_HOME: $JAVA_HOME"
java --version # java --version
java --version | grep "Temurin" || exit 23 # java --version | grep "Temurin" || exit 23
native-image --version # native-image --version
if: ${{ runner.os != 'Windows' }} # if: ${{ runner.os != 'Windows' }}
- name: Check Windows environment # - name: Check Windows environment
run: | # run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME" # echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" # echo "JAVA_HOME: $env:JAVA_HOME"
java --version # java --version
native-image --version # native-image --version
if: ${{ runner.os == 'Windows' }} # if: ${{ runner.os == 'Windows' }}
test-action-liberica: # test-action-liberica:
needs: test-action # needs: test-action
name: Liberica (${{ matrix.java-version }}, '${{ matrix.java-package }}', ${{ matrix.os }}) # name: Liberica (${{ matrix.java-version }}, '${{ matrix.java-package }}', ${{ matrix.os }})
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
strategy: # strategy:
matrix: # matrix:
java-version: ['17', '21.0.2'] # java-version: ['17', '21.0.2']
java-package: ['', 'jdk', 'jdk+fx'] # java-package: ['', 'jdk', 'jdk+fx']
os: [ubuntu-latest, macos-latest, windows-latest] # os: [ubuntu-latest, macos-latest, windows-latest]
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
distribution: liberica # distribution: liberica
java-version: ${{ matrix.java-version }} # java-version: ${{ matrix.java-version }}
java-package: ${{ matrix.java-package }} # java-package: ${{ matrix.java-package }}
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment # - name: Check environment
run: | # run: |
echo "GRAALVM_HOME: $GRAALVM_HOME" # echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12 # [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME" # echo "JAVA_HOME: $JAVA_HOME"
java --version # java --version
java --version | fgrep -qw ${{ matrix.java-version }} || exit 23 # java --version | fgrep -qw ${{ matrix.java-version }} || exit 23
native-image --version # native-image --version
native-image --version | fgrep -qw ${{ matrix.java-version }} || exit 24 # native-image --version | fgrep -qw ${{ matrix.java-version }} || exit 24
if: ${{ runner.os != 'Windows' }} # if: ${{ runner.os != 'Windows' }}
- name: Check Windows environment # - name: Check Windows environment
shell: pwsh # shell: pwsh
run: | # run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME" # echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME" # echo "JAVA_HOME: $env:JAVA_HOME"
java --version # java --version
if (!(java --version | findstr \<${{ matrix.java-version }}\>)) { # if (!(java --version | findstr \<${{ matrix.java-version }}\>)) {
exit 23 # exit 23
} # }
native-image --version # native-image --version
if (!(native-image --version | findstr \<${{ matrix.java-version }}\>)) { # if (!(native-image --version | findstr \<${{ matrix.java-version }}\>)) {
exit 24 # exit 24
} # }
if: ${{ runner.os == 'Windows' }} # if: ${{ runner.os == 'Windows' }}
test-action-native-image-windows: # test-action-native-image-windows:
name: native-image on windows-latest # name: native-image on windows-latest
runs-on: windows-latest # runs-on: windows-latest
permissions: # permissions:
contents: read # contents: read
pull-requests: write # for `native-image-pr-reports` option # pull-requests: write # for `native-image-pr-reports` option
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
java-version: 'dev' # java-version: 'dev'
distribution: 'graalvm-community' # distribution: 'graalvm-community'
native-image-job-reports: 'true' # native-image-job-reports: 'true'
native-image-pr-reports: 'true' # native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build HelloWorld executable with GraalVM Native Image on Windows # - name: Build HelloWorld executable with GraalVM Native Image on Windows
run: | # run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java # echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java # javac HelloWorld.java
native-image HelloWorld # native-image HelloWorld
./helloworld # ./helloworld
test-action-native-image-windows-msvc: # test-action-native-image-windows-msvc:
name: native-image on windows-2022 # name: native-image on windows-2022
runs-on: windows-2022 # runs-on: windows-2022
permissions: # permissions:
contents: read # contents: read
pull-requests: write # for `native-image-pr-reports` option # pull-requests: write # for `native-image-pr-reports` option
steps: # steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action # - name: Run setup-graalvm action
uses: ./ # uses: ./
with: # with:
java-version: '17' # java-version: '17'
distribution: 'graalvm' # distribution: 'graalvm'
native-image-job-reports: 'true' # native-image-job-reports: 'true'
native-image-pr-reports: 'true' # native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build HelloWorld executable with GraalVM Native Image on Windows # - name: Build HelloWorld executable with GraalVM Native Image on Windows
run: | # run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java # echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java # javac HelloWorld.java
native-image HelloWorld # native-image HelloWorld
./helloworld # ./helloworld
test-action-native-image-musl: test-action-native-image-musl-ce:
name: native-image-musl on ubuntu-latest name: native-image-musl on ubuntu-latest
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
@@ -394,9 +394,10 @@ jobs:
javac HelloWorld.java javac HelloWorld.java
native-image --static --libc=musl HelloWorld native-image --static --libc=musl HelloWorld
./helloworld ./helloworld
native-image --static --libc=musl -m jdk.httpserver
test-action-extensive: ./jdk.httpserver --help
name: extensive tests on ubuntu-latest test-action-native-image-musl:
name: native-image-musl on ubuntu-latest
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
@@ -406,84 +407,111 @@ jobs:
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
java-version: '17.0.8' java-version: '25'
distribution: 'graalvm' distribution: 'graalvm'
components: 'espresso,llvm-toolchain,native-image,nodejs,python,ruby,wasm' native-image-musl: 'true'
set-java-home: 'false'
native-image-job-reports: 'true' native-image-job-reports: 'true'
native-image-pr-reports: 'true' native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment - name: Build static HelloWorld executable with GraalVM Native Image and musl
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
[[ "$GRAALVM_HOME" != "$JAVA_HOME" ]] || exit 12
[[ $(which java) == *"graalvm"* ]] || exit 23
java --version
java -truffle --version
gu --version
gu list
[[ $(which lli) == *"graalvm"* ]] || exit 34
lli --version
native-image --version
[[ $(which node) == *"graalvm"* ]] || exit 45
node --version
graalpy --version
truffleruby --version
wasm --version
- name: Build HelloWorld.java with GraalVM Native Image
run: | run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java javac HelloWorld.java
native-image -g HelloWorld native-image --static --libc=musl HelloWorld
./helloworld ./helloworld
# - name: Build Ruby-FFI with TruffleRuby native-image --static --libc=musl --gc=G1 -m jdk.httpserver
# run: | ./jdk.httpserver --help
# [[ $(which bundle) == *"graalvm"* ]] || exit 57
# git clone --depth 1 https://github.com/ffi/ffi.git
# pushd ffi > /dev/null
# # https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
# bundle install
# bundle exec rake libffi
# bundle exec rake compile
# bundle exec rake test
# popd > /dev/null
- name: Remove components
run: gu remove espresso llvm-toolchain nodejs python ruby wasm
test-action-sbom:
name: test 'native-image-enable-sbom' option # test-action-extensive:
runs-on: ${{ matrix.os }} # name: extensive tests on ubuntu-latest
permissions: # runs-on: ubuntu-latest
contents: write # permissions:
strategy: # contents: read
matrix: # pull-requests: write # for `native-image-pr-reports` option
java-version: ['25', 'latest-ea'] # steps:
distribution: ['graalvm'] # - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
os: [macos-latest, windows-latest, ubuntu-latest, ubuntu-22.04-arm] # - name: Run setup-graalvm action
components: [''] # uses: ./
steps: # with:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 # java-version: '17.0.8'
- name: Run setup-graalvm action # distribution: 'graalvm'
uses: ./ # components: 'espresso,llvm-toolchain,native-image,nodejs,python,ruby,wasm'
with: # set-java-home: 'false'
java-version: ${{ matrix.java-version }} # native-image-job-reports: 'true'
distribution: ${{ matrix.distribution }} # native-image-pr-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
components: ${{ matrix.components }} # - name: Check environment
native-image-enable-sbom: 'true' # run: |
cache: 'maven' # echo "GRAALVM_HOME: $GRAALVM_HOME"
- name: Build Maven project and verify that SBOM was generated and its contents # echo "JAVA_HOME: $JAVA_HOME"
run: | # [[ "$GRAALVM_HOME" != "$JAVA_HOME" ]] || exit 12
cd __tests__/sbom/main-test-app # [[ $(which java) == *"graalvm"* ]] || exit 23
mvn --no-transfer-progress -Pnative package # java --version
bash verify-sbom.sh # java -truffle --version
shell: bash # gu --version
if: ${{ runner.os != 'Windows' }} # gu list
- name: Build Maven project and verify that SBOM was generated and its contents (Windows) # [[ $(which lli) == *"graalvm"* ]] || exit 34
run: | # lli --version
cd __tests__\sbom\main-test-app # native-image --version
mvn --no-transfer-progress -Pnative package # [[ $(which node) == *"graalvm"* ]] || exit 45
cmd /c verify-sbom.cmd # node --version
shell: cmd # graalpy --version
if: ${{ runner.os == 'Windows' }} # truffleruby --version
# wasm --version
# - name: Build HelloWorld.java with GraalVM Native Image
# run: |
# echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
# javac HelloWorld.java
# native-image -g HelloWorld
# ./helloworld
# # - name: Build Ruby-FFI with TruffleRuby
# # run: |
# # [[ $(which bundle) == *"graalvm"* ]] || exit 57
# # git clone --depth 1 https://github.com/ffi/ffi.git
# # pushd ffi > /dev/null
# # # https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
# # bundle install
# # bundle exec rake libffi
# # bundle exec rake compile
# # bundle exec rake test
# # popd > /dev/null
# - name: Remove components
# run: gu remove espresso llvm-toolchain nodejs python ruby wasm
# test-action-sbom:
# name: test 'native-image-enable-sbom' option
# runs-on: ${{ matrix.os }}
# permissions:
# contents: write
# strategy:
# matrix:
# java-version: ['25', 'latest-ea']
# distribution: ['graalvm']
# os: [macos-latest, windows-latest, ubuntu-latest, ubuntu-22.04-arm]
# components: ['']
# steps:
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# - name: Run setup-graalvm action
# uses: ./
# with:
# java-version: ${{ matrix.java-version }}
# distribution: ${{ matrix.distribution }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# components: ${{ matrix.components }}
# native-image-enable-sbom: 'true'
# cache: 'maven'
# - name: Build Maven project and verify that SBOM was generated and its contents
# run: |
# cd __tests__/sbom/main-test-app
# mvn --no-transfer-progress -Pnative package
# bash verify-sbom.sh
# shell: bash
# if: ${{ runner.os != 'Windows' }}
# - name: Build Maven project and verify that SBOM was generated and its contents (Windows)
# run: |
# cd __tests__\sbom\main-test-app
# mvn --no-transfer-progress -Pnative package
# cmd /c verify-sbom.cmd
# shell: cmd
# if: ${{ runner.os == 'Windows' }}

20
dist/main.js generated vendored
View File

@@ -88826,8 +88826,8 @@ function checkForUpdates(graalVMVersion, javaVersion) {
// TODO: add support for JDK-specific update checks (e.g., 17.0.X) // TODO: add support for JDK-specific update checks (e.g., 17.0.X)
} }
const MUSL_NAME = 'x86_64-linux-musl-native'; const MUSL_VERSION = '1.2.5.1';
const MUSL_VERSION = '10.2.1'; const MUSL_NAME = 'musl-toolchain';
async function setUpNativeImageMusl() { async function setUpNativeImageMusl() {
if (!IS_LINUX) { if (!IS_LINUX) {
coreExports.warning('musl is only supported on Linux'); coreExports.warning('musl is only supported on Linux');
@@ -88839,23 +88839,9 @@ async function setUpNativeImageMusl() {
} }
else { else {
coreExports.startGroup(`Setting up musl for GraalVM Native Image...`); coreExports.startGroup(`Setting up musl for GraalVM Native Image...`);
const muslDownloadPath = await toolCacheExports.downloadTool(`https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz`); const muslDownloadPath = await toolCacheExports.downloadTool(`https://github.com/graalvm/setup-graalvm/releases/download/v1.3.7/musl-toolchain-amd64-1.2.5-gcc10.3.0-zlib1.2.13.tar.gz`);
const muslExtractPath = await toolCacheExports.extractTar(muslDownloadPath); const muslExtractPath = await toolCacheExports.extractTar(muslDownloadPath);
const muslPath = join(muslExtractPath, MUSL_NAME); const muslPath = join(muslExtractPath, MUSL_NAME);
const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2';
const zlibDownloadPath = await toolCacheExports.downloadTool(`https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`);
const zlibExtractPath = await toolCacheExports.extractTar(zlibDownloadPath);
const zlibPath = join(zlibExtractPath, `zlib-${zlibCommit}`);
const zlibBuildOptions = {
cwd: zlibPath,
env: {
...process.env,
CC: join(muslPath, 'bin', 'gcc')
}
};
await exec('./configure', [`--prefix=${muslPath}`, '--static'], zlibBuildOptions);
await exec('make', [], zlibBuildOptions);
await exec('make', ['install'], { cwd: zlibPath });
coreExports.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`); coreExports.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`);
toolPath = await toolCacheExports.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION); toolPath = await toolCacheExports.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION);
coreExports.endGroup(); coreExports.endGroup();

View File

@@ -1,11 +1,10 @@
import * as c from '../constants.js' import * as c from '../constants.js'
import * as core from '@actions/core' import * as core from '@actions/core'
import * as tc from '@actions/tool-cache' import * as tc from '@actions/tool-cache'
import { exec } from '../utils.js'
import { join } from 'path' import { join } from 'path'
const MUSL_NAME = 'x86_64-linux-musl-native' const MUSL_VERSION = '1.2.5.1'
const MUSL_VERSION = '10.2.1' const MUSL_NAME = 'musl-toolchain'
export async function setUpNativeImageMusl(): Promise<void> { export async function setUpNativeImageMusl(): Promise<void> {
if (!c.IS_LINUX) { if (!c.IS_LINUX) {
@@ -18,26 +17,10 @@ export async function setUpNativeImageMusl(): Promise<void> {
} else { } else {
core.startGroup(`Setting up musl for GraalVM Native Image...`) core.startGroup(`Setting up musl for GraalVM Native Image...`)
const muslDownloadPath = await tc.downloadTool( const muslDownloadPath = await tc.downloadTool(
`https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz` `https://github.com/graalvm/setup-graalvm/releases/download/v1.3.7/musl-toolchain-amd64-1.2.5-gcc10.3.0-zlib1.2.13.tar.gz`
) )
const muslExtractPath = await tc.extractTar(muslDownloadPath) const muslExtractPath = await tc.extractTar(muslDownloadPath)
const muslPath = join(muslExtractPath, MUSL_NAME) const muslPath = join(muslExtractPath, MUSL_NAME)
const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2'
const zlibDownloadPath = await tc.downloadTool(`https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`)
const zlibExtractPath = await tc.extractTar(zlibDownloadPath)
const zlibPath = join(zlibExtractPath, `zlib-${zlibCommit}`)
const zlibBuildOptions = {
cwd: zlibPath,
env: {
...process.env,
CC: join(muslPath, 'bin', 'gcc')
}
}
await exec('./configure', [`--prefix=${muslPath}`, '--static'], zlibBuildOptions)
await exec('make', [], zlibBuildOptions)
await exec('make', ['install'], { cwd: zlibPath })
core.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`) core.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`)
toolPath = await tc.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION) toolPath = await tc.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION)
core.endGroup() core.endGroup()