-
Notifications
You must be signed in to change notification settings - Fork 919
42 lines (39 loc) · 1.44 KB
/
reusable-native-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Reusable - Native tests
on:
workflow_call:
inputs:
skip-native-tests:
type: boolean
required: false
test-latest-deps:
type: boolean
required: false
permissions:
contents: read
jobs:
graalvm-native-tests:
if: "!inputs.skip-native-tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: read-java
run: echo "version=$(cat .java-version)" >> "$GITHUB_OUTPUT"
- uses: graalvm/setup-graalvm@aafbedb8d382ed0ca6167d3a051415f20c859274 # v1.2.8.1
with:
version: "latest"
java-version: "${{ steps.read-java.outputs.version }}"
components: "native-image"
- name: Running test
env:
DOCKER_COMPOSE_TEST: "true"
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
# Testcontainers does not work in some cases with GraalVM native images,
# therefore we're starting a Kafka container manually for the tests
docker compose -f .github/graal-native-docker-compose.yaml up -d
# don't wait for startup - gradle compile takes long enough
./gradlew ${{ inputs.test-latest-deps && '-PtestLatestDeps=true' || '' }} nativeTest
docker compose -f .github/graal-native-docker-compose.yaml down # is this needed?