mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-06-02 07:27:33 +00:00
[CI] add CI scripts separate from the workflows (#442)
_[One line description of your change]_ ### Motivation: _[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_ ### Modifications: _[Describe the modifications you've done.]_ ### Result: _[After your change, what will change.]_
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
##===----------------------------------------------------------------------===##
|
||||
##
|
||||
## This source file is part of the SwiftAWSLambdaRuntime open source project
|
||||
##
|
||||
## Copyright (c) 2017-2024 Apple Inc. and the SwiftAWSLambdaRuntime project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
## See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
|
||||
##
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
##
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
EXAMPLE=HelloWorld
|
||||
OUTPUT_DIR=.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager
|
||||
OUTPUT_FILE=${OUTPUT_DIR}/MyLambda/bootstrap
|
||||
ZIP_FILE=${OUTPUT_DIR}/MyLambda/MyLambda.zip
|
||||
|
||||
pushd Examples/${EXAMPLE} || exit 1
|
||||
|
||||
# package the example (docker and swift toolchain are installed on the GH runner)
|
||||
LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker || exit 1
|
||||
|
||||
# did the plugin generated a Linux binary?
|
||||
[ -f "${OUTPUT_FILE}" ]
|
||||
file "${OUTPUT_FILE}" | grep --silent ELF
|
||||
|
||||
# did the plugin created a ZIP file?
|
||||
[ -f "${ZIP_FILE}" ]
|
||||
|
||||
# does the ZIP file contain the bootstrap?
|
||||
unzip -l "${ZIP_FILE}" | grep --silent bootstrap
|
||||
|
||||
echo "✅ The archive plugin is OK"
|
||||
popd || exit 1
|
||||
Reference in New Issue
Block a user