Skip to content

Commit a74fb71

Browse files
committed
make it easier to run graal native tests
1 parent 553fbb3 commit a74fb71

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

.github/scripts/native-tests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash -e
2+
3+
echo "GRAALVM_HOME: $GRAALVM_HOME"
4+
echo "JAVA_HOME: $JAVA_HOME"
5+
java --version
6+
native-image --version
7+
# Testcontainers does not work in some cases with GraalVM native images,
8+
# therefore we're starting a Kafka container manually for the tests
9+
docker compose -f .github/graal-native-docker-compose.yaml up -d
10+
# don't wait for startup - gradle compile takes long enough
11+
12+
EXTRA_ARGS=""
13+
if [[ $TEST_LATEST_DEPS == "true" ]]
14+
then
15+
EXTRA_ARGS="-PtestLatestDeps=true"
16+
fi
17+
18+
./gradlew $EXTRA_ARGS nativeTest
19+
docker compose -f .github/graal-native-docker-compose.yaml down

.github/workflows/reusable-native-tests.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,8 @@ jobs:
3030
with:
3131
version: "latest"
3232
java-version: ${{ matrix.test-java-version }}
33-
components: "native-image"
3433
- name: Running test
3534
env:
3635
DOCKER_COMPOSE_TEST: "true"
37-
run: |
38-
echo "GRAALVM_HOME: $GRAALVM_HOME"
39-
echo "JAVA_HOME: $JAVA_HOME"
40-
java --version
41-
native-image --version
42-
# Testcontainers does not work in some cases with GraalVM native images,
43-
# therefore we're starting a Kafka container manually for the tests
44-
docker compose -f .github/graal-native-docker-compose.yaml up -d
45-
# don't wait for startup - gradle compile takes long enough
46-
./gradlew ${{ inputs.test-latest-deps && '-PtestLatestDeps=true' || '' }} nativeTest
47-
docker compose -f .github/graal-native-docker-compose.yaml down # is this needed?
36+
TEST_LATEST_DEPS: ${{ inputs.test-latest-deps && 'true' || 'false' }}
37+
run: .github/scripts/native-tests.sh

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[tasks.graalvm-native-tests]
2+
tools.java = "graalvm-community-22.0.2"
3+
file = ".github/scripts/native-tests.sh"
4+
# todo figure out how to pass this env.TEST_LATEST_DEPS = "{{flag(name='latest-deps')}}"
5+

0 commit comments

Comments
 (0)