Skip to content

Commit 1f093b9

Browse files
committed
fix ci
1 parent a896700 commit 1f093b9

File tree

5 files changed

+8
-37
lines changed

5 files changed

+8
-37
lines changed

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ on:
77
type: string
88
description: "The name of the workflow used for the concurrency group."
99
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: ""
1810
examples_enabled:
1911
type: boolean
2012
description: "Boolean to enable the compilation of examples. Defaults to true."
@@ -32,10 +24,6 @@ on:
3224
type: boolean
3325
description: "Boolean to enable the check for Foundation dependency. Defaults to true."
3426
default: true
35-
matrix_linux_command:
36-
type: string
37-
description: "The command of the current Swift version linux matrix job to execute."
38-
required: true
3927
matrix_linux_swift_container_image:
4028
type: string
4129
description: "Container image for the matrix job. Defaults to matching latest Swift 6.1 Amazon Linux 2 image."
@@ -48,19 +36,9 @@ concurrency:
4836

4937
jobs:
5038
test-examples:
51-
name: Test Examples/${{ matrix.examples }} on ${{ matrix.swift.swift_version }}
39+
name: Test Examples
5240
if: ${{ inputs.examples_enabled }}
5341
runs-on: ubuntu-latest
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
examples: ${{ fromJson(inputs.examples) }}
58-
59-
# We are using only one Swift version
60-
swift:
61-
- image: ${{ inputs.matrix_linux_swift_container_image }}
62-
container:
63-
image: ${{ matrix.swift.image }}
6442
steps:
6543
# GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2
6644
# workaround is to manually checkout the repository
@@ -89,11 +67,8 @@ jobs:
8967
# https://github.com/actions/checkout/issues/766
9068
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
9169

92-
- name: Run matrix job
70+
- name: Run build for all examples
9371
working-directory: ${{ github.event.repository.name }} # until we can use action/checkout@v4
94-
env:
95-
COMMAND: ${{ inputs.matrix_linux_command }}
96-
EXAMPLE: ${{ matrix.examples }}
9772
run: |
9873
.github/workflows/scripts/integration_tests.sh
9974

.github/workflows/pull_request.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ jobs:
3232
with:
3333
name: "Integration tests"
3434
examples_enabled: true
35-
matrix_linux_command: "LAMBDA_USE_LOCAL_DEPS=.. swift build"
3635
# We pass the list of examples targets here, but we can't pass an array as argument
3736
# Instead, we pass a String with a valid JSON array.
3837
# The workaround is mentioned here https://github.com/orgs/community/discussions/11692
39-
examples: "[ 'APIGateway', 'APIGatewayLambda', 'AuthorizerLambda', 'BackgroundTasks', 'CDKAPIGAtewayLambda','HelloJSON', 'HelloWorld', 'ResourcesPackaging', 'S3EventNotifier', 'AWSSDKExample', 'SotoExample', 'StreamingNumbers', 'TestedLambda', 'Palindrome' ]"
4038
archive_plugin_examples: "[ 'HelloWorld', 'ResourcesPackaging' ]"
4139
archive_plugin_enabled: true
4240

.github/workflows/scripts/check-archive-plugin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ OUTPUT_DIR=.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager
2323
OUTPUT_FILE=${OUTPUT_DIR}/MyLambda/bootstrap
2424
ZIP_FILE=${OUTPUT_DIR}/MyLambda/MyLambda.zip
2525

26-
pushd "Examples/${EXAMPLE}" || exit 1
26+
pushd "Examples" || exit 1
2727

2828
# package the example (docker and swift toolchain are installed on the GH runner)
29-
LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker || exit 1
29+
LAMBDA_USE_LOCAL_DEPS=.. swift package archive --product "${EXAMPLE}" --allow-network-connections docker || exit 1
3030

3131
# did the plugin generated a Linux binary?
3232
[ -f "${OUTPUT_FILE}" ]

.github/workflows/scripts/check-link-foundation.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ fatal() { error "$@"; exit 1; }
1919

2020
EXAMPLE=APIGateway
2121
OUTPUT_DIR=.build/release
22-
OUTPUT_FILE=${OUTPUT_DIR}/APIGatewayLambda
22+
OUTPUT_FILE=${OUTPUT_DIR}/APIGateway
2323
LIBS_TO_CHECK="libFoundation.so libFoundationInternationalization.so lib_FoundationICU.so"
2424

25-
pushd Examples/${EXAMPLE} || fatal "Failed to change directory to Examples/${EXAMPLE}."
25+
pushd Examples || fatal "Failed to change directory to Examples."
2626

2727
# recompile the example without the --static-swift-stdlib flag
28-
LAMBDA_USE_LOCAL_DEPS=../.. swift build -c release -Xlinker -s || fatal "Failed to build the example."
28+
LAMBDA_USE_LOCAL_DEPS=.. swift build --target "${EXAMPLE}" -c release -Xlinker -s || fatal "Failed to build the example."
2929

3030
# check if the binary exists
3131
if [ ! -f "${OUTPUT_FILE}" ]; then

.github/workflows/scripts/integration_tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ fatal() { error "$@"; exit 1; }
2121

2222
SWIFT_VERSION=$(swift --version)
2323
test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset"
24-
test -n "${COMMAND:-}" || fatal "COMMAND unset"
25-
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"
2624

2725
pushd Examples > /dev/null
2826

2927
log "Running command with Swift $SWIFT_VERSION"
30-
eval "$COMMAND --target $EXAMPLE"
28+
eval "swift build && swift test"
3129

3230
popd

0 commit comments

Comments
 (0)