Skip to content

Test GraalVM native image #198

Test GraalVM native image

Test GraalVM native image #198

name: Test GraalVM native image
on:
schedule:
- cron: '0 4 ? * SUN,THU'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checkout tls-gen
uses: actions/checkout@v4
with:
repository: rabbitmq/tls-gen
path: './tls-gen'
- name: Checkout GraalVM test project
uses: actions/checkout@v4
with:
repository: rabbitmq/rabbitmq-graal-vm-test
path: './rabbitmq-graal-vm-test'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '21'
cache: 'maven'
- name: Start broker
run: ci/start-broker.sh
- name: Get dependencies
run: make deps
- name: Install client JAR file
run: |
./mvnw clean install -Psnapshots -DskipITs -DskipTests -Dgpg.skip=true --no-transfer-progress
export ARTEFACT_VERSION=$(cat pom.xml | grep -oPm1 "(?<=<version>)[^<]+")
echo "artefact_version=$ARTEFACT_VERSION" >> $GITHUB_ENV
- name: Package test application
working-directory: rabbitmq-graal-vm-test
run: |
./mvnw --version
echo "Using RabbitMQ Java Client ${{ env.artefact_version }}"
./mvnw -q clean package -Damqp-client.version=${{ env.artefact_version }} --no-transfer-progress
- name: Start one-time RPC server
working-directory: rabbitmq-graal-vm-test
run: ./mvnw -q compile exec:java -Damqp-client.version=${{ env.artefact_version }} --no-transfer-progress &
- name: Create native image
working-directory: rabbitmq-graal-vm-test
run: |
native-image -jar target/rabbitmq-graal-vm-test-full.jar \
--initialize-at-build-time=com.rabbitmq.client \
--initialize-at-build-time=org.slf4j --no-fallback
- name: Use native image program
working-directory: rabbitmq-graal-vm-test
run: ./rabbitmq-graal-vm-test-full
- name: Stop broker
run: docker stop rabbitmq && docker rm rabbitmq