Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8cca089

Browse files
committedDec 22, 2024
move test plugin to a separate script
1 parent fc9c96f commit 8cca089

File tree

2 files changed

+42
-21
lines changed

2 files changed

+42
-21
lines changed
 

‎.github/workflows/integration_tests.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -108,28 +108,9 @@ jobs:
108108
# https://github.com/actions/checkout/issues/766
109109
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
110110
- name: Test the archive plugin
111-
env:
112-
EXAMPLE: HelloWorld
113-
OUTPUT_FILE: .build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/bootstrap
114-
ZIP_FILE: .build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip
115111
run: |
116-
pushd Examples/${EXAMPLE}
117-
118-
# package the example (docker and swift toolchain are installed on the GH runner)
119-
LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker
120-
121-
# did the plugin generated a Linux binary?
122-
[ -f ${OUTPUT_FILE} ]
123-
file ${OUTPUT_FILE} | grep --silent ELF
124-
125-
# did the plugin created a ZIP file?
126-
[ -f ${ZIP_FILE} ]
127-
128-
# does the ZIP file contain the bootstrap?
129-
unzip -l ${ZIP_FILE} | grep --silent bootstrap
130-
131-
echo "✅ The archive plugin is OK"
132-
popd
112+
which curl yq || (apt -q update && apt -yq install curl yq)
113+
curl -s https://raw.githubusercontent.com/swift-sever/swift-aws-lambda-runtime/refs/heads/main/.github/workflows/scripts/check-archive-plugin.sh | bash
133114
134115
check-foundation:
135116
name: No dependencies on Foundation
@@ -145,4 +126,5 @@ jobs:
145126
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
146127
- name: Check for Foundation or ICU dependency
147128
run: |
129+
which curl yq || (apt -q update && apt -yq install curl yq)
148130
curl -s https://raw.githubusercontent.com/swift-sever/swift-aws-lambda-runtime/refs/heads/main/.github/workflows/scripts/check-link-foundation.sh | bash
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the SwiftAWSLambdaRuntime open source project
5+
##
6+
## Copyright (c) 2017-2024 Apple Inc. and the SwiftAWSLambdaRuntime project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
## See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
11+
##
12+
## SPDX-License-Identifier: Apache-2.0
13+
##
14+
##===----------------------------------------------------------------------===##
15+
16+
#!/bin/bash
17+
18+
EXAMPLE=HelloWorld
19+
OUTPUT_DIR=.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager
20+
OUTPUT_FILE=${OUTPUT_DIR}/MyLambda/bootstrap
21+
ZIP_FILE=${OUTPUT_DIR}/MyLambda/MyLambda.zip
22+
23+
pushd Examples/${EXAMPLE} || exit 1
24+
25+
# package the example (docker and swift toolchain are installed on the GH runner)
26+
LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker || exit 1
27+
28+
# did the plugin generated a Linux binary?
29+
[ -f "${OUTPUT_FILE}" ]
30+
file "${OUTPUT_FILE}" | grep --silent ELF
31+
32+
# did the plugin created a ZIP file?
33+
[ -f "${ZIP_FILE}" ]
34+
35+
# does the ZIP file contain the bootstrap?
36+
unzip -l "${ZIP_FILE}" | grep --silent bootstrap
37+
38+
echo "✅ The archive plugin is OK"
39+
popd || exit 1

0 commit comments

Comments
 (0)
Please sign in to comment.