Skip to content

Commit c67c04c

Browse files
committed
more fixes
1 parent 8cca089 commit c67c04c

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

.github/workflows/integration_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
110110
- name: Test the archive plugin
111111
run: |
112-
which curl yq || (apt -q update && apt -yq install curl yq)
112+
which curl || (apt -q update && apt -yq install curl)
113113
curl -s https://raw.githubusercontent.com/swift-sever/swift-aws-lambda-runtime/refs/heads/main/.github/workflows/scripts/check-archive-plugin.sh | bash
114114
115115
check-foundation:
@@ -126,5 +126,5 @@ jobs:
126126
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
127127
- name: Check for Foundation or ICU dependency
128128
run: |
129-
which curl yq || (apt -q update && apt -yq install curl yq)
130-
curl -s https://raw.githubusercontent.com/swift-sever/swift-aws-lambda-runtime/refs/heads/main/.github/workflows/scripts/check-link-foundation.sh | bash
129+
which curl || (apt -q update && apt -yq install curl)
130+
curl -s https://raw.githubusercontent.com/swift-server/swift-aws-lambda-runtime/refs/heads/main/.github/workflows/scripts/check-link-foundation.sh | bash

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
#!/bin/bash
17-
1816
EXAMPLE=HelloWorld
1917
OUTPUT_DIR=.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager
2018
OUTPUT_FILE=${OUTPUT_DIR}/MyLambda/bootstrap

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,23 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
#!/bin/bash
16+
log() { printf -- "** %s\n" "$*" >&2; }
17+
error() { printf -- "** ERROR: %s\n" "$*" >&2; }
18+
fatal() { error "$@"; exit 1; }
1719

1820
EXAMPLE=APIGateway
1921
OUTPUT_DIR=.build/release
2022
OUTPUT_FILE=${OUTPUT_DIR}/APIGatewayLambda
2123
LIBS_TO_CHECK="libFoundation.so libFoundationInternationalization.so lib_FoundationICU.so"
2224

23-
pushd Examples/${EXAMPLE} || exit 1
25+
pushd Examples/${EXAMPLE} || fatal "Failed to change directory to Examples/${EXAMPLE}."
2426

2527
# recompile the example without the --static-swift-stdlib flag
26-
LAMBDA_USE_LOCAL_DEPS=../.. swift build -c release -Xlinker -s
28+
LAMBDA_USE_LOCAL_DEPS=../.. swift build -c release -Xlinker -s || fatal "Failed to build the example."
2729

2830
# check if the binary exists
2931
if [ ! -f "${OUTPUT_FILE}" ]; then
30-
echo "${OUTPUT_FILE} does not exist."
31-
exit 1
32+
error "${OUTPUT_FILE} does not exist."
3233
fi
3334

3435
# Checking for Foundation or ICU dependencies
@@ -42,10 +43,10 @@ for LIB in ${LIBS_TO_CHECK}; do
4243

4344
# 1 is success (grep failed to find the lib), 0 is failure (grep successly found the lib)
4445
SUCCESS=$?
45-
[ "$SUCCESS" -eq 0 ] && echo "${LIB} found." && break || echo "${LIB} not found."
46+
[ "$SUCCESS" -eq 0 ] && log "${LIB} found." && break || log "${LIB} not found."
4647
done
4748

48-
popd || exit 1
49+
popd || fatal "Failed to change directory back to the root directory."
4950

5051
# exit code is the opposite of the grep exit code
51-
[ "$SUCCESS" -eq 0 ] && echo "❌ At least one foundation lib was found, reporting the error." && exit 1 || echo "✅ No foundation lib found, congrats!" && exit 0
52+
[ "$SUCCESS" -eq 0 ] && error "❌ At least one foundation lib was found, reporting the error." || log "✅ No foundation lib found, congrats!" && exit 0

0 commit comments

Comments
 (0)