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

40 lines
1.4 KiB
YAML

name: Reusable - Native tests
on:
workflow_call:
inputs:
skip-native-tests:
type: boolean
required: false
test-latest-deps:
type: boolean
required: false
jobs:
graalvm-native-tests:
if: "!inputs.skip-native-tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- id: read-java
run: echo "version=$(cat .java-version)" >> "$GITHUB_OUTPUT"
- uses: graalvm/setup-graalvm@22cc13fe88ef133134b3798e128fb208df55e1f5 # v1.2.3.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?