Merge pull request #30 from graalvm/upgrade-reflection-workshop-to-jdk24 #144
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Native Image Reflection Workshop Pipeline | |
on: | |
push: | |
paths: | |
- 'native-image/reflection/lab/**' | |
- '.github/workflows/github-actions-native-image-reflection.yml' | |
jobs: | |
build: | |
name: Native Image Reflection on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GraalVM | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '24' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and run | |
run: | | |
cd native-image/reflection/lab/ | |
javac ReflectionExample.java | |
java -agentlib:native-image-agent=config-output-dir=META-INF/native-image ReflectionExample StringReverser reverse "hello" | |
java -agentlib:native-image-agent=config-merge-dir=META-INF/native-image ReflectionExample StringCapitalizer capitalize "hello" | |
native-image ReflectionExample | |
./reflectionexample StringReverser reverse "hello" | |
./reflectionexample StringCapitalizer capitalize "hello" |