Skip to content

Commit 8ba5bee

Browse files
committed
try to pass an array of examples to test
1 parent 7ca4fb9 commit 8ba5bee

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/workflows/examples.yml renamed to .github/workflows/integration_tests.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ on:
77
type: string
88
description: "The name of the workflow used for the concurrency group."
99
required: true
10-
# examples:
11-
# type: sequence
12-
# description: "The examples to run."
13-
# required: true
10+
# We pass the list of examples here, but we can't pass an array as argument
11+
# Instead, we pass a String with a valid JSON array.
12+
# The workaround is mentioned here https://github.com/orgs/community/discussions/11692
13+
examples:
14+
type: string
15+
description: "The list of examples to run. Pass a String with a valid JSON array such as \"[ 'HelloWorld', 'APIGAteway' ]\""
16+
required: true
17+
default: ""
1418
examples_enabled:
1519
type: boolean
1620
description: "Boolean to enable the compilation of examples. Defaults to true."
@@ -41,9 +45,7 @@ jobs:
4145
strategy:
4246
fail-fast: false
4347
matrix:
44-
# This should be passed as an argument in input. Can we pass arrays as argument ?
45-
examples: ["HelloWorld", "APIGateway", "S3_AWSSDK", "S3_Soto"]
46-
# examples: ${{ inputs.examples }}
48+
examples: ${{ fromJson(inputs.examples }}
4749

4850
# We are using only one Swift version
4951
swift:

.github/workflows/pull_request.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ jobs:
2828

2929
integration-tests:
3030
name: Integration Tests
31-
uses: ./.github/workflows/examples.yml
31+
uses: ./.github/workflows/integration_tests.yml
3232
with:
3333
name: "Integration tests"
3434
examples_enabled: true
35-
# We should pass the list of examples here, but we can't pass an array as argument
36-
# examples: [ "HelloWorld", "APIGateway" ]
3735
matrix_linux_command: "LAMBDA_USE_LOCAL_DEPS=../.. swift build"
36+
# We pass the list of examples here, but we can't pass an array as argument
37+
# Instead, we pass a String with a valid JSON array.
38+
# The workaround is mentioned here https://github.com/orgs/community/discussions/11692
39+
examples: "[ 'HelloWorld', 'APIGateway','S3_AWSSDK', 'S3_Soto' ]"
40+
3841
archive_plugin_enabled: true
3942

4043
swift-6-language-mode:

0 commit comments

Comments
 (0)