-
Notifications
You must be signed in to change notification settings - Fork 348
80 lines (68 loc) · 2.24 KB
/
graalvm-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: GraalVM Integration Tests
on:
workflow_call:
pull_request:
branches:
- master
paths:
- 'integration/graalvm/**'
jobs:
graalvm-integration:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: integration/graalvm
strategy:
max-parallel: 1
matrix:
server: ['ktor-graalvm-server', 'maven-graalvm-server', 'spring-graalvm-server']
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm'
components: 'native-image'
native-image-job-reports: 'true'
- name: Set up Gradle cache
uses: gradle/gradle-build-action@v2
- name: Build native image
timeout-minutes: 20
id: build_server
run: |
./gradlew :${server}:buildGraalVmNativeImage
echo "NATIVE_IMAGE=$(echo "${server}/build/native/nativeCompile/${server}")" >> $GITHUB_OUTPUT
env:
server: ${{ matrix.server }}
- name: Start the native image
id: start_server
run: |
set -x
echo "starting server"
./${nativeImage} &
echo "SERVER_PID=$(echo $!)" >> $GITHUB_OUTPUT
env:
nativeImage: ${{ steps.build_server.outputs.NATIVE_IMAGE }}
- name: Integration Test
run: |
echo "sending a test query"
curl --request POST \
--verbose \
--header 'content-type: application/json' \
--url http://localhost:8080/graphql \
--data '{"query":"query($inputArg: InputOnlyInput){ inputTypeQuery(arg: $inputArg) }","variables":{"inputArg": { "id": 123 }}}' \
> response.json
echo "received GraphQL response"
cat response.json
echo "verifying response"
jq -e '.data.inputTypeQuery == "InputOnly(id=123)"' response.json
- name: Stop server
if: ${{ always() }}
run: |
echo "shutting down server"
kill -9 ${{ steps.start_server.outputs.SERVER_PID }}