-
Notifications
You must be signed in to change notification settings - Fork 259
363 lines (352 loc) · 11.9 KB
/
build_test_invoke.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
name: Build
on:
pull_request:
branches: [master, "feat*"]
merge_group:
types: [checks_requested]
branches: [master, "feat*"]
env:
PYTHON_VERSION_INSTALL: '3.7'
SAM_CLI_DEV: 1
PIP_CARGO_LAMBDA_VERSION: '0.17.1'
jobs:
run-workflow:
name: Build & Test & Invoke Templates
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
needs:
- build-test-python
- build-test-java
- build-test-nodejs
- build-test-ruby
- build-test-rust
- build-test-golang
- build-test-dotnet
- test-manifest
steps:
- name: report-failure
if: |
needs.build-test-python.result != 'success' ||
needs.build-test-java.result != 'success' ||
needs.build-test-nodejs.result != 'success' ||
needs.build-test-ruby.result != 'success' ||
needs.build-test-rust.result != 'success' ||
needs.build-test-golang.result != 'success' ||
needs.build-test-dotnet.result != 'success' ||
needs.test-manifest.result != 'success'
run: exit 1
- name: report-success
run: exit 0
################
# Test Manifest
test-manifest:
name: Test Manifest File
if: github.repository_owner == 'aws'
env:
PYTHON_VERSION_INSTALL: '3.11'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: actions/setup-python@v4
name: Setup Python 3.11
with:
python-version: '3.11'
- name: Run build tests for tests/unit/
run: |
pip install -r requirements.txt
pytest -n auto -vvv tests/unit/
################
# Python
build-test-python:
name: ${{ matrix.type }} / Python ${{ matrix.version }}
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
include:
- version: '3.7'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_python3_7.py'
- version: '3.7'
type: 'Invoke'
file: 'tests/integration/build_invoke/python/test_python_3_7.py'
- version: '3.8'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_python3_8.py'
- version: '3.8'
type: 'Invoke'
file: 'tests/integration/build_invoke/python/test_python_3_8.py'
- version: '3.9'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_python3_9.py'
- version: '3.9'
type: 'Invoke'
file: 'tests/integration/build_invoke/python/test_python_3_9.py'
- version: '3.10'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_python3_10.py'
- version: '3.10'
type: 'Invoke'
file: 'tests/integration/build_invoke/python/test_python_3_10.py'
- version: '3.11'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_python3_11.py'
- version: '3.11'
type: 'Invoke'
file: 'tests/integration/build_invoke/python/test_python_3_11.py'
env:
PYTHON_VERSION_INSTALL: ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
env:
PYTHON_VERSION_INSTALL: ${{ matrix.version }}
- uses: actions/setup-python@v4
name: Setup Python ${{ matrix.version }}
with:
python-version: ${{ matrix.version }}
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
pytest -n auto -vvv ${{ matrix.file }}
################
# Java
build-test-java:
name: ${{ matrix.type }} / Java ${{ matrix.version }}
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
include:
- version: '8'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_java8.py'
- version: '8'
type: 'Test (AL2)'
file: 'tests/integration/unit_test/test_unit_test_java8_al2.py'
- version: '8'
type: 'Invoke'
file: 'tests/integration/build_invoke/java/test_java_8.py'
- version: '8'
type: 'Invoke (AL2)'
file: 'tests/integration/build_invoke/java/test_java_8_al2.py'
- version: '11'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_java11.py'
- version: '11'
type: 'Invoke'
file: 'tests/integration/build_invoke/java/test_java_11.py'
- version: '11'
type: 'Invoke (AL2)'
file: 'tests/integration/build_invoke/java/test_java_11_al2.py'
- version: '17'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_java17.py'
- version: '17'
type: 'Invoke'
file: 'tests/integration/build_invoke/java/test_java_17.py'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
- uses: actions/setup-java@v3
name: Setup Java ${{ matrix.version }}
with:
distribution: 'corretto'
java-version: ${{ matrix.version }}
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
gradle --version
mvn --version
pytest -n auto -vvv ${{ matrix.file }}
################
# NodeJS
build-test-nodejs:
name: ${{ matrix.type }} / NodeJS ${{ matrix.version }}
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
include:
- version: '14'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_nodejs14_x.py'
- version: '14'
type: 'Invoke'
file: 'tests/integration/build_invoke/node/test_node_14.py'
- version: '16'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_nodejs16_x.py'
- version: '16'
type: 'Invoke'
file: 'tests/integration/build_invoke/node/test_node_16.py'
- version: '18'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_nodejs18_x.py'
- version: '18'
type: 'Invoke'
file: 'tests/integration/build_invoke/node/test_node_18.py'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
- uses: actions/setup-node@v3
name: Setup NodeJS ${{ matrix.version }}
with:
node-version: ${{ matrix.version }}
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
echo "node: $(node --version)"
echo "npm: $(npm --version)"
pytest -n auto -vvv ${{ matrix.file }}
################
# Ruby
build-test-ruby:
name: ${{ matrix.type }} / Ruby ${{ matrix.version }}
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
include:
- version: '2.7'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_ruby2_7.py'
- version: '2.7'
type: 'Invoke'
file: 'tests/integration/build_invoke/test_ruby_2_7.py'
- version: '3.2'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_ruby3_2.py'
- version: '3.2'
type: 'Invoke'
file: 'tests/integration/build_invoke/test_ruby_3_2.py'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
- uses: ruby/setup-ruby@v1
name: Setup Ruby ${{ matrix.version }}
with:
ruby-version: ${{ matrix.version }}
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
ruby --version
pytest -n auto -vvv ${{ matrix.file }}
################
# Rust
build-test-rust:
name: ${{ matrix.type }} / Rust
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_rust.py'
- type: 'Invoke'
file: 'tests/integration/build_invoke/test_build_invoke_rust.py'
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
- name: Setup Rust
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y
source $HOME/.cargo/env
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
rustup target add x86_64-unknown-linux-gnu --toolchain stable
rustup target add aarch64-unknown-linux-gnu --toolchain stable
pip install cargo-lambda==$PIP_CARGO_LAMBDA_VERSION
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
rustc -V
cargo -V
cargo lambda -V
pytest -n auto -vvv ${{ matrix.file }}
################
# golang
build-test-golang:
name: ${{ matrix.type }} / golang ${{ matrix.version }}
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- version: '1.x'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_go1_x.py'
- version: '1.x'
type: 'Invoke'
file: 'tests/integration/build_invoke/test_build_invoke_go1_x.py'
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
- uses: actions/setup-go@v3
name: Setup golang ${{ matrix.version }}
with:
go-version: ${{ matrix.version }}
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
go version
pytest -n auto -vvv ${{ matrix.file }}
################
# dotnet
build-test-dotnet:
name: ${{ matrix.type }} / dotnet ${{ matrix.version }}
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- version: '6'
type: 'Test'
file: 'tests/integration/unit_test/test_unit_test_dotnet6.py'
- version: '6'
type: 'Invoke'
file: 'tests/integration/build_invoke/dotnet/test_build_invoke_dotnet6.py'
steps:
- uses: actions/checkout@v3
name: Checkout PR
- uses: ./.github/actions/aws-sam-cli-develop
name: Install develop version of AWS SAM CLI
- uses: actions/setup-dotnet@v3
name: Setup dotnet ${{ matrix.version }}
with:
dotnet-version: ${{ matrix.version }}
- name: Run build tests for ${{ matrix.file }}
run: |
pip install -r requirements.txt
samdev --info
dotnet --info
dotnet --version
pytest -vvv ${{ matrix.file }}