Skip to content

Commit 0e374ab

Browse files
committed
Merge branch 'main' into sebsto/servicelifecycle
2 parents 9b0a617 + b2811a5 commit 0e374ab

File tree

156 files changed

+2782
-1638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2782
-1638
lines changed

.github/workflows/integration_tests.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ on:
1919
type: boolean
2020
description: "Boolean to enable the compilation of examples. Defaults to true."
2121
default: true
22+
archive_plugin_examples:
23+
type: string
24+
description: "The list of examples to run through the archive plugin test. Pass a String with a valid JSON array such as \"[ 'HelloWorld', 'APIGateway' ]\""
25+
required: true
26+
default: ""
2227
archive_plugin_enabled:
2328
type: boolean
2429
description: "Boolean to enable the test of the archive plugin. Defaults to true."
@@ -33,8 +38,8 @@ on:
3338
required: true
3439
matrix_linux_swift_container_image:
3540
type: string
36-
description: "Container image for the matrix job. Defaults to matching latest Swift Ubuntu image."
37-
default: "swift:amazonlinux2"
41+
description: "Container image for the matrix job. Defaults to matching latest Swift 6.1 Amazon Linux 2 image."
42+
default: "swiftlang/swift:nightly-6.1-amazonlinux2"
3843

3944
## We are cancelling previously triggered workflow runs
4045
concurrency:
@@ -54,7 +59,6 @@ jobs:
5459
# We are using only one Swift version
5560
swift:
5661
- image: ${{ inputs.matrix_linux_swift_container_image }}
57-
swift_version: "6.0.1-amazonlinux2"
5862
container:
5963
image: ${{ matrix.swift.image }}
6064
steps:
@@ -88,7 +92,6 @@ jobs:
8892
- name: Run matrix job
8993
working-directory: ${{ github.event.repository.name }} # until we can use action/checkout@v4
9094
env:
91-
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
9295
COMMAND: ${{ inputs.matrix_linux_command }}
9396
EXAMPLE: ${{ matrix.examples }}
9497
run: |
@@ -98,6 +101,10 @@ jobs:
98101
name: Test archive plugin
99102
if: ${{ inputs.archive_plugin_enabled }}
100103
runs-on: ubuntu-latest
104+
strategy:
105+
fail-fast: false
106+
matrix:
107+
examples: ${{ fromJson(inputs.archive_plugin_examples) }}
101108
steps:
102109
- name: Checkout repository
103110
uses: actions/checkout@v4
@@ -107,8 +114,10 @@ jobs:
107114
# https://github.com/actions/checkout/issues/766
108115
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
109116
- name: Test the archive plugin
117+
env:
118+
EXAMPLE: ${{ matrix.examples }}
110119
run: |
111-
.github/workflows/scripts/check-archive-plugin.sh
120+
.github/workflows/scripts/check-archive-plugin.sh
112121
113122
check-foundation:
114123
name: No dependencies on Foundation

.github/workflows/pull_request.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
license_header_check_project_name: "SwiftAWSLambdaRuntime"
1313
shell_check_enabled: true
1414
python_lint_check_enabled: true
15-
api_breakage_check_container_image: "swift:6.0-noble"
15+
api_breakage_check_container_image: "swiftlang/swift:nightly-6.1-jammy"
1616
docs_check_container_image: "swift:6.0-noble"
17-
format_check_container_image: "swiftlang/swift:nightly-6.0-jammy"
17+
format_check_container_image: "swiftlang/swift:nightly-6.1-jammy"
1818
yamllint_check_enabled: true
1919

2020
unit-tests:
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
linux_5_9_enabled: false
2525
linux_5_10_enabled: false
26-
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
26+
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
2727
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2828

2929
integration-tests:
@@ -36,8 +36,8 @@ jobs:
3636
# We pass the list of examples here, but we can't pass an array as argument
3737
# Instead, we pass a String with a valid JSON array.
3838
# The workaround is mentioned here https://github.com/orgs/community/discussions/11692
39-
examples: "[ 'APIGateway', 'APIGateway+LambdaAuthorizer', 'BackgroundTasks', 'HelloJSON', 'HelloWorld', 'S3_AWSSDK', 'S3_Soto', 'Streaming', 'Testing', 'Tutorial' ]"
40-
39+
examples: "[ 'APIGateway', 'APIGateway+LambdaAuthorizer', 'BackgroundTasks', 'HelloJSON', 'HelloWorld', 'ResourcesPackaging', 'S3EventNotifier', 'S3_AWSSDK', 'S3_Soto', 'Streaming', 'Testing', 'Tutorial' ]"
40+
archive_plugin_examples: "[ 'HelloWorld', 'ResourcesPackaging' ]"
4141
archive_plugin_enabled: true
4242

4343
swift-6-language-mode:

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
EXAMPLE=HelloWorld
16+
log() { printf -- "** %s\n" "$*" >&2; }
17+
error() { printf -- "** ERROR: %s\n" "$*" >&2; }
18+
fatal() { error "$@"; exit 1; }
19+
20+
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"
21+
1722
OUTPUT_DIR=.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager
1823
OUTPUT_FILE=${OUTPUT_DIR}/MyLambda/bootstrap
1924
ZIP_FILE=${OUTPUT_DIR}/MyLambda/MyLambda.zip
2025

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

2328
# package the example (docker and swift toolchain are installed on the GH runner)
2429
LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker || exit 1
@@ -33,5 +38,17 @@ file "${OUTPUT_FILE}" | grep --silent ELF
3338
# does the ZIP file contain the bootstrap?
3439
unzip -l "${ZIP_FILE}" | grep --silent bootstrap
3540

36-
echo "✅ The archive plugin is OK"
41+
# if EXAMPLE is ResourcesPackaging, check if the ZIP file contains hello.txt
42+
if [ "$EXAMPLE" == "ResourcesPackaging" ]; then
43+
echo "Checking if resource was added to the ZIP file"
44+
unzip -l "${ZIP_FILE}" | grep --silent hello.txt
45+
SUCCESS=$?
46+
if [ "$SUCCESS" -eq 1 ]; then
47+
log "❌ Resource not found." && exit 1
48+
else
49+
log "✅ Resource found."
50+
fi
51+
fi
52+
53+
echo "✅ The archive plugin is OK with example ${EXAMPLE}"
3754
popd || exit 1

.github/workflows/scripts/integration_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ log() { printf -- "** %s\n" "$*" >&2; }
1919
error() { printf -- "** ERROR: %s\n" "$*" >&2; }
2020
fatal() { error "$@"; exit 1; }
2121

22+
SWIFT_VERSION=$(swift --version)
2223
test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset"
2324
test -n "${COMMAND:-}" || fatal "COMMAND unset"
2425
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Package.resolved
1111
.serverless
1212
.vscode
1313
Makefile
14-
.devcontainer
14+
.devcontainer
15+
.amazonq

.licenseignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ Package.resolved
3333
*.yaml
3434
*.yml
3535
**/.npmignore
36-
**/*.json
36+
**/*.json
37+
**/*.txt

.spi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version: 1
22
builder:
33
configs:
4-
- documentation_targets: [AWSLambdaRuntimeCore, AWSLambdaRuntime]
4+
- documentation_targets: [AWSLambdaRuntime]

Examples/APIGateway+LambdaAuthorizer/Package.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ import PackageDescription
55
// needed for CI to test the local version of the library
66
import struct Foundation.URL
77

8-
#if os(macOS)
9-
let platforms: [PackageDescription.SupportedPlatform]? = [.macOS(.v15)]
10-
#else
11-
let platforms: [PackageDescription.SupportedPlatform]? = nil
12-
#endif
13-
148
let package = Package(
159
name: "swift-aws-lambda-runtime-example",
1610
platforms: [.macOS(.v15)],
@@ -21,7 +15,7 @@ let package = Package(
2115
dependencies: [
2216
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
2317
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"),
24-
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"),
18+
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
2519
],
2620
targets: [
2721
.executableTarget(

Examples/APIGateway/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
dependencies: [
1515
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
1616
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"),
17-
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"),
17+
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
1818
],
1919
targets: [
2020
.executableTarget(

Examples/CDK/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
dependencies: [
1515
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
1616
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"),
17-
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", branch: "main"),
17+
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
1818
],
1919
targets: [
2020
.executableTarget(

0 commit comments

Comments
 (0)