reusable-native-tests.yml 1.4 KB

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