-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
azure-pipelines.yml
239 lines (205 loc) · 8.95 KB
/
azure-pipelines.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: $(Date:yyyyMMdd)-$(BuildID)
trigger:
- master
pool:
name: Default
pr: none
jobs:
# Tasks health check
- job: tasks_health_check_1
displayName: '(1.0) General tasks tests'
condition: succeeded()
strategy:
matrix:
# DOCKER_GRAALVM_CE_LATEST:
# GRAALVM_IMAGE:
DOCKER_GRAALVM_CE_LATEST_MINUS_ONE:
GRAALVM_IMAGE: ghcr.io/fierycod/holy-lambda-builder:amd64-java11-21.2.0
# DOCKER_GRAALVM_EE_LATEST:
# GRAALVM_IMAGE: fierycod/graalvm-native-image:ee
variables:
HL_DOCKER_IMAGE: $(GRAALVM_IMAGE)
WORKING_DIRECTORY: examples/bb/native/basic.example
steps:
- bash: |
# Bucket deletion
printf "\n------------------------------------------------------\n"
printf " (1) Doctor check "
printf "\n------------------------------------------------------\n"
#------------------------
bb hl:doctor || exit 1
echo "------------------------------------------------------"
# Stack version test
printf "\n------------------------------------------------------\n"
printf " (2) Stack version "
printf "\n------------------------------------------------------\n"
#------------------------
bb hl:version || exit 1
echo "------------------------------------------------------"
# Basic stack compilation
printf "\n------------------------------------------------------\n"
printf " (3) Stack compilation "
printf "\n------------------------------------------------------\n"
#------------------------
bb hl:compile || exit 1
echo "------------------------------------------------------"
# Basic stack compilation
printf "\n------------------------------------------------------\n"
printf " (4) Stack compilation + Force "
printf "\n------------------------------------------------------\n"
#------------------------
bb hl:compile :force || exit 1
echo "------------------------------------------------------"
# Stack local run test
printf "\n------------------------------------------------------\n"
printf " (5) In docker:run in local context fail "
printf "\n------------------------------------------------------\n"
#------------------------
HL_NO_DOCKER=true bb hl:docker:run "something" && exit 1 || printf "\033[0;32mTest passed!\033[0m\n"
echo "------------------------------------------------------"
# Stack purge test
printf "\n------------------------------------------------------\n"
printf " (7) Build clean "
printf "\n------------------------------------------------------\n"
#------------------------
bb hl:clean || exit 1
echo "------------------------------------------------------"
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Tasks health check'
# Native + Docker runtime tests
- job: native_basic_docker_1
displayName: '(2.1)-(Native)-(Basic)-(Docker) GraalVM Native Image Custom Runtime compilation test'
dependsOn:
- tasks_health_check_1
condition: succeeded()
strategy:
matrix:
DOCKER_GRAALVM_CE_LATEST_MINUS_ONE:
GRAALVM_IMAGE: ghcr.io/fierycod/holy-lambda-builder:amd64-java11-21.2.0
variables:
HL_DOCKER_IMAGE: $(GRAALVM_IMAGE)
WORKING_DIRECTORY: examples/bb/native/basic.example
steps:
- bash: |
bb hl:compile && \
bb hl:native:executable && \
output=$(sam local invoke "ExampleLambdaFunction" 2> /dev/null | jq .body -r) && \
echo "$output" && \
bb -e "(assert (= \"$output\" \"Hello world\"))"
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Compilation + Invoke'
# Clojure + Docker runtime tests
- job: clojure_basic_docker_1
displayName: '(3.1)-(Clojure)-(Basic)-(Docker) Clojure runtime test'
dependsOn:
- tasks_health_check_1
condition: succeeded()
strategy:
matrix:
DOCKER_GRAALVM_CE_LATEST_MINUS_ONE:
GRAALVM_IMAGE: ghcr.io/fierycod/holy-lambda-builder:amd64-java11-21.2.0
variables:
HL_DOCKER_IMAGE: $(GRAALVM_IMAGE)
WORKING_DIRECTORY: examples/bb/clojure/basic.example
steps:
- script: |
# Regular test tasks
bb hl:compile && \
sam build && \
output=$(sam local invoke "ExampleLambdaFunction" 2> /dev/null | jq .body -r) && \
echo "$output" && \
bb -e "(assert (= \"$output\" \"Hello world\"))"
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Compilation + Invoke'
- job: babashka_basic_build_1
displayName: '(4.1) Build Babashka layer'
dependsOn:
- tasks_health_check_1
condition: succeeded()
variables:
WORKING_DIRECTORY: modules/holy-lambda-babashka-layer
steps:
- script: |
rm -Rf holy-lambda-babashka-runtime.zip
bb publish.clj render
bb publish.clj build
rm -Rf ~/.az-agent/local_cache/holy-lambda-babashka-runtime-*.zip
cp holy-lambda-babashka-runtime-amd64.zip ~/.az-agent/local_cache/
cp holy-lambda-babashka-runtime-arm64.zip ~/.az-agent/local_cache/
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Build holy-lambda-babashka layer'
# Babashka based tests
- job: babashka_basic_docker_1
displayName: '(5.1)-(Babashka)-(Basic)-(Docker) Babashka runtime test'
strategy:
matrix:
DOCKER_GRAALVM_CE_LATEST_MINUS_ONE:
GRAALVM_IMAGE: ghcr.io/fierycod/holy-lambda-builder:amd64-java11-21.2.0
dependsOn:
- tasks_health_check_1
- babashka_basic_build_1
condition: succeeded()
variables:
HL_DOCKER_IMAGE: $(GRAALVM_IMAGE)
WORKING_DIRECTORY: examples/bb/babashka/basic.example
steps:
- script: |
# Copy freshly build babashka runtime
cp ~/.az-agent/local_cache/holy-lambda-babashka-runtime-*.zip . && unzip -qq holy-lambda-babashka-runtime-amd64.zip -d holy-lambda-babashka-runtime-amd64 && unzip -qq holy-lambda-babashka-runtime-arm64.zip -d holy-lambda-babashka-runtime-arm64
bb hl:babashka:sync
# Test
output=$(sam local invoke "ExampleLambdaFunction" 2> /dev/null | jq .body -r) && \
echo "$output" && \
bb -e "(assert (= \"$output\" \"Hello world. Babashka is sweet friend of mine! Babashka version: 0.7.4\"))"
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Basic babashka invoke'
# Babashka based tests
- job: babashka_basic_docker_2
displayName: '(5.2)-(Babashka)-(Basic)-(Docker) Babashka runtime test v2'
strategy:
matrix:
DOCKER_GRAALVM_CE_LATEST_MINUS_ONE:
GRAALVM_IMAGE: ghcr.io/fierycod/holy-lambda-builder:amd64-java11-21.2.0
dependsOn:
- tasks_health_check_1
- babashka_basic_build_1
condition: succeeded()
variables:
HL_DOCKER_IMAGE: $(GRAALVM_IMAGE)
WORKING_DIRECTORY: examples/bb/babashka/aws-pod.example
steps:
- script: |
# Copy freshly build babashka runtime
cp ~/.az-agent/local_cache/holy-lambda-babashka-runtime-*.zip . && unzip -qq holy-lambda-babashka-runtime-amd64.zip -d holy-lambda-babashka-runtime-amd64 && unzip -qq holy-lambda-babashka-runtime-arm64.zip -d holy-lambda-babashka-runtime-arm64
bb hl:babashka:sync
# Test
output=$(sam local invoke "ExampleLambdaFunction" 2> /dev/null | jq .body -r) && \
echo "$output" && \
bb -e "(assert (= \"$output\" \"true\"))"
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Basic babashka invoke v2'
# Native + Docker runtime tests
- job: native_no_list_docker_1
displayName: '(2.1)-(Native built-time-no-list)-(S3)-(Docker) GraalVM Native Image Custom Runtime compilation test'
dependsOn:
- tasks_health_check_1
condition: succeeded()
strategy:
matrix:
DOCKER_GRAALVM_CE_LATEST_MINUS_ONE:
GRAALVM_IMAGE: ghcr.io/fierycod/holy-lambda-builder:amd64-java11-21.2.0
variables:
HL_DOCKER_IMAGE: $(GRAALVM_IMAGE)
WORKING_DIRECTORY: examples/bb/native/hl.aws-bucket
steps:
- script: |
# Regular test tasks
bb hl:compile && \
bb hl:native:conf && \
bb hl:native:executable
# Test
output=$(sam local invoke "ExampleLambdaFunction" 2> /dev/null | jq .body -r) && \
echo "$output" && \
bb -e "(assert (= \"$output\" \"true\"))"
workingDirectory: ${{variables.WORKING_DIRECTORY}}
displayName: 'Compilation + Invoke'