Skip to content

Commit 0014f08

Browse files
committed
Test microservices in separate jobs for Maven+Gradle.
1 parent 59b47e7 commit 0014f08

File tree

2 files changed

+84
-27
lines changed

2 files changed

+84
-27
lines changed

.github/workflows/graalpy-micronaut-guide.yml

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ permissions:
1414
env:
1515
NATIVE_IMAGE_OPTIONS: '-J-Xmx16g'
1616
jobs:
17-
run:
18-
name: 'graalpy-micronaut-guide'
17+
maven:
18+
name: 'graalpy-micronaut-guide on Maven'
1919
runs-on: ubuntu-latest
20-
timeout-minutes: 45
20+
timeout-minutes: 30
2121
steps:
2222
- uses: actions/checkout@v4
2323
- uses: graalvm/setup-graalvm@v1
@@ -26,7 +26,7 @@ jobs:
2626
distribution: 'graalvm'
2727
github-token: ${{ secrets.GITHUB_TOKEN }}
2828
cache: 'maven'
29-
- name: Build, test, and run 'graalpy-micronaut-guide' using Maven
29+
- name: Build, test, and run 'graalpy-micronaut-guide'
3030
run: |
3131
cd graalpy/graalpy-micronaut-guide
3232
git clean -fdx
@@ -36,25 +36,15 @@ jobs:
3636
sleep 30
3737
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
3838
kill $mnpid
39-
- name: Build, test, and run 'graalpy-micronaut-guide' using Gradle
40-
run: |
41-
cd graalpy/graalpy-micronaut-guide
42-
git clean -fdx
43-
./gradlew test -Dmicronaut.http.client.read-timeout=1m
44-
./gradlew run &
45-
mnpid="$!"
46-
sleep 30
47-
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
48-
kill $mnpid
4939
- uses: graalvm/setup-graalvm@v1
5040
with:
5141
java-version: '24.0.0'
5242
distribution: 'graalvm'
5343
github-token: ${{ secrets.GITHUB_TOKEN }}
5444
cache: 'maven'
55-
set-java-home: false # keep using previous JAVA_HOME, but use different GRAALVM_JAVA_HOME for generating native image
45+
set-java-home: false # keep using previous JAVA_HOME, but use different GRAALVM_HOME for generating native image
5646
native-image-job-reports: 'true'
57-
- name: Build and run native 'graalpy-micronaut-guide' using Maven
47+
- name: Build and run native 'graalpy-micronaut-guide'
5848
run: |
5949
cd graalpy/graalpy-micronaut-guide
6050
git clean -fdx
@@ -64,7 +54,37 @@ jobs:
6454
sleep 20
6555
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
6656
kill $mnpid
67-
- name: Build and run native 'graalpy-micronaut-guide' using Gradle
57+
gradle:
58+
name: 'graalpy-micronaut-guide on Gradle'
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 30
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: graalvm/setup-graalvm@v1
64+
with:
65+
java-version: '21.0.6'
66+
distribution: 'graalvm'
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
cache: 'gradle'
69+
- name: Build, test, and run 'graalpy-micronaut-guide'
70+
run: |
71+
cd graalpy/graalpy-micronaut-guide
72+
git clean -fdx
73+
./gradlew test -Dmicronaut.http.client.read-timeout=1m
74+
./gradlew run &
75+
mnpid="$!"
76+
sleep 30
77+
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
78+
kill $mnpid
79+
- uses: graalvm/setup-graalvm@v1
80+
with:
81+
java-version: '24.0.0'
82+
distribution: 'graalvm'
83+
github-token: ${{ secrets.GITHUB_TOKEN }}
84+
cache: 'gradle'
85+
set-java-home: false # keep using previous JAVA_HOME, but use different GRAALVM_JAVA_HOME for generating native image
86+
native-image-job-reports: 'true'
87+
- name: Build and run native 'graalpy-micronaut-guide'
6888
run: |
6989
cd graalpy/graalpy-micronaut-guide
7090
git clean -fdx

.github/workflows/graalpy-spring-boot-guide.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ permissions:
1414
env:
1515
NATIVE_IMAGE_OPTIONS: '-J-Xmx16g'
1616
jobs:
17-
run:
18-
name: 'graalpy-spring-boot-guide'
17+
maven:
18+
name: 'graalpy-spring-boot-guide on Maven'
1919
runs-on: ubuntu-latest
20-
timeout-minutes: 45
20+
timeout-minutes: 30
2121
steps:
2222
- uses: actions/checkout@v4
2323
- uses: graalvm/setup-graalvm@v1
2424
with:
25-
java-version: '24.0.0'
25+
java-version: '21.0.6'
2626
distribution: 'graalvm'
2727
github-token: ${{ secrets.GITHUB_TOKEN }}
2828
cache: 'maven'
29-
native-image-job-reports: 'true'
30-
- name: Build, test, and run 'graalpy-spring-boot-guide' using Maven
29+
- name: Build, test, and run 'graalpy-spring-boot-guide'
3130
run: |
3231
cd graalpy/graalpy-spring-boot-guide
3332
git clean -fdx
@@ -37,7 +36,37 @@ jobs:
3736
sleep 30
3837
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
3938
kill $sbpid
40-
- name: Build, test, and run 'graalpy-spring-boot-guide' using Gradle
39+
- uses: graalvm/setup-graalvm@v1
40+
with:
41+
java-version: '24.0.0'
42+
distribution: 'graalvm'
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
cache: 'maven'
45+
set-java-home: false # keep using previous JAVA_HOME, but use different GRAALVM_JAVA_HOME for generating native image
46+
native-image-job-reports: 'true'
47+
- name: Build and run native 'graalpy-spring-boot-guide'
48+
run: |
49+
cd graalpy/graalpy-spring-boot-guide
50+
git clean -fdx
51+
./mvnw --no-transfer-progress clean -DskipTests -Pnative native:compile
52+
./target/graalpy-springboot &
53+
sbpid="$!"
54+
sleep 20
55+
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
56+
kill $sbpid
57+
gradle:
58+
name: 'graalpy-spring-boot-guide on Gradle'
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 30
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: graalvm/setup-graalvm@v1
64+
with:
65+
java-version: '21.0.6'
66+
distribution: 'graalvm'
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
cache: 'gradle'
69+
- name: Build, test, and run 'graalpy-spring-boot-guide'
4170
run: |
4271
cd graalpy/graalpy-spring-boot-guide
4372
git clean -fdx
@@ -47,12 +76,20 @@ jobs:
4776
sleep 30
4877
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/
4978
kill $sbpid
50-
- name: Build and run native 'graalpy-spring-boot-guide' using Maven
79+
- uses: graalvm/setup-graalvm@v1
80+
with:
81+
java-version: '24.0.0'
82+
distribution: 'graalvm'
83+
github-token: ${{ secrets.GITHUB_TOKEN }}
84+
cache: 'gradle'
85+
set-java-home: false # keep using previous JAVA_HOME, but use different GRAALVM_HOME for generating native image
86+
native-image-job-reports: 'true'
87+
- name: Build and run native 'graalpy-mispring-boot-guide'
5188
run: |
5289
cd graalpy/graalpy-spring-boot-guide
5390
git clean -fdx
54-
./mvnw --no-transfer-progress clean -DskipTests -Pnative native:compile
55-
./target/graalpy-springboot &
91+
./gradlew nativeCompile
92+
./build/native/nativeCompile/demo &
5693
sbpid="$!"
5794
sleep 20
5895
curl --fail-with-body --silent --dump-header - -o /dev/null http://localhost:8080/

0 commit comments

Comments
 (0)