Skip to content

Use --fail-with-body to fail the job if curl fails. #9

Use --fail-with-body to fail the job if curl fails.

Use --fail-with-body to fail the job if curl fails. #9

name: Test GraalPy Micronaut Guide
on:
push:
paths:
- 'graalpy/graalpy-micronaut-guide/**'
- '.github/workflows/graalpy-micronaut-guide.yml'
pull_request:
paths:
- 'graalpy/graalpy-micronaut-guide/**'
- '.github/workflows/graalpy-micronaut-guide.yml'
workflow_dispatch:
permissions:
contents: read
env:
NATIVE_IMAGE_OPTIONS: '-J-Xmx16g'
jobs:
run:
name: 'graalpy-micronaut-guide'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '23.0.0'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
native-image-job-reports: 'true'
- name: Build, test, and run 'graalpy-micronaut-guide' using Maven
run: |
cd graalpy/graalpy-micronaut-guide
./mvnw --no-transfer-progress clean test -Dmicronaut.http.client.read-timeout=1m
./mvnw --no-transfer-progress mn:run &
mnpid="$!"
sleep 30
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
kill $mnpid
- name: Build and run native 'graalpy-micronaut-guide' using Maven
run: |
cd graalpy/graalpy-micronaut-guide
./mvnw --no-transfer-progress clean package -DskipTests -Dpackaging=native-image
./target/graalpy-micronaut &
mnpid="$!"
sleep 20
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
kill $mnpid