opentelemetry-java-instrume.../.github/workflows/reusable-native-tests.yml

37 lines
1.3 KiB
YAML

name: Reusable - Native tests
on:
workflow_call:
inputs:
skip-native-tests:
type: boolean
required: false
jobs:
graalvm-native-tests:
if: "!inputs.skip-native-tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: read-java
run: echo "version=$(cat .java-version)" >> "$GITHUB_OUTPUT"
- uses: graalvm/setup-graalvm@2f25c0caae5b220866f732832d5e3e29ff493338 # v1.2.1.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 nativeTest
docker compose -f .github/graal-native-docker-compose.yaml down # is this needed?