diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8146bb4f..2b0ac9e4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,11 +10,12 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main with: license_header_check_project_name: "SwiftAWSLambdaRuntime" - shell_check_enabled: false - python_lint_check_enabled: false + shell_check_enabled: true + python_lint_check_enabled: true api_breakage_check_container_image: "swift:6.0-noble" docs_check_container_image: "swift:6.0-noble" format_check_container_image: "swiftlang/swift:nightly-6.0-jammy" + yamllint_check_enabled: true unit-tests: name: Unit tests @@ -43,6 +44,18 @@ jobs: name: Swift 6 Language Mode uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main + semver-label-check: + name: Semantic Version label check + runs-on: ubuntu-latest + timeout-minutes: 1 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Check for Semantic Version label + uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main + # until there is a support for musl in swiftlang/github-workflows # https://github.com/swiftlang/github-workflows/issues/34 musl: diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-01-package-init.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-01-package-init.sh index a54719a3..be756692 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-01-package-init.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-01-package-init.sh @@ -1,2 +1,3 @@ +# shellcheck disable=all # Create a project directory mkdir SquareNumber && cd SquareNumber \ No newline at end of file diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-02-package-init.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-02-package-init.sh index a96b825c..c991cb0d 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-02-package-init.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-02-package-init.sh @@ -1,3 +1,4 @@ +# shellcheck disable=all # Create a project directory mkdir SquareNumber && cd SquareNumber # create a skeleton project diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-03-package-init.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-03-package-init.sh index aa6e4926..8afef332 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-03-package-init.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-03-package-init.sh @@ -1,3 +1,4 @@ +# shellcheck disable=all # Create a project directory mkdir SquareNumber && cd SquareNumber # create a skeleton project diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-04-package-init.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-04-package-init.sh index fc946011..89167eb5 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-04-package-init.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-04-package-init.sh @@ -1,3 +1,4 @@ +# shellcheck disable=all # Create a project directory mkdir SquareNumber && cd SquareNumber # create a skeleton project diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-03-console-output.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-03-console-output.sh index 7ba3caf2..8e4a9630 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-03-console-output.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-03-console-output.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + 2023-04-14T11:42:21+0200 info LocalLambdaServer : [AWSLambdaRuntimeCore] LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke 2023-04-14T11:42:21+0200 info Lambda : [AWSLambdaRuntimeCore] lambda runtime starting with LambdaConfiguration General(logLevel: info)) diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-04-curl.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-04-curl.sh index 46dbccc0..31102f68 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-04-curl.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-04-curl.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + curl --header "Content-Type: application/json" \ --request POST \ --data '{"number": 3}' \ diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-05-curl.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-05-curl.sh index c5dcbe12..c5f90a8c 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-05-curl.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-05-curl.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + curl --header "Content-Type: application/json" \ --request POST \ --data '{"number": 3}' \ diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-06-terminal.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-06-terminal.sh index 39c4f4d7..a6439f30 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-06-terminal.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-06-terminal.sh @@ -1,2 +1,3 @@ -export LOCAL_LAMBDA_SERVER_ENABLED=true +# shellcheck disable=all +export LOCAL_LAMBDA_SERVER_ENABLED=true diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-07-terminal.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-07-terminal.sh index f6bc5e7f..529df84f 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-07-terminal.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-07-terminal.sh @@ -1,2 +1,4 @@ +# shellcheck disable=all + export LOCAL_LAMBDA_SERVER_ENABLED=true swift run diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-08-terminal.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-08-terminal.sh index b1a57a88..38245018 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-08-terminal.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-08-terminal.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + export LOCAL_LAMBDA_SERVER_ENABLED=true swift run diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-02-plugin-archive.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-02-plugin-archive.sh index dc8fad5c..097ba893 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-02-plugin-archive.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-02-plugin-archive.sh @@ -1,2 +1,4 @@ +# shellcheck disable=all + swift package archive --allow-network-connections docker diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-03-plugin-archive.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-03-plugin-archive.sh index 0a5fc72e..b85f866b 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-03-plugin-archive.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-03-plugin-archive.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + swift package archive --allow-network-connections docker ------------------------------------------------------------------------- diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-04-plugin-archive.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-04-plugin-archive.sh index 90e47e41..93489314 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-04-plugin-archive.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-04-plugin-archive.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + swift package archive --allow-network-connections docker ------------------------------------------------------------------------- diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-01-aws-cli.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-01-aws-cli.sh index 7a33b49d..8e10fd15 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-01-aws-cli.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-01-aws-cli.sh @@ -1 +1,3 @@ +# shellcheck disable=all + aws --version diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke-hidden.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke-hidden.sh index 9e66559e..ae79ebc6 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke-hidden.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke-hidden.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + # # --region the AWS Region to send the command # --function-name the name of your function diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke.sh index 52c3c549..ba3c2e53 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + # # --region the AWS Region to send the command # --function-name the name of your function diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-03-lambda-invoke.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-03-lambda-invoke.sh index 569e75ea..78818b3b 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-03-lambda-invoke.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-03-lambda-invoke.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + # # --region the AWS Region to send the command # --function-name the name of your function diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-04-lambda-invoke.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-04-lambda-invoke.sh index c31e7e4b..4cfb4ca8 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-04-lambda-invoke.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-04-lambda-invoke.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + # # --region the AWS Region to send the command # --function-name the name of your function diff --git a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-05-lambda-invoke.sh b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-05-lambda-invoke.sh index 54a198bd..fa8d6653 100644 --- a/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-05-lambda-invoke.sh +++ b/Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-05-lambda-invoke.sh @@ -1,3 +1,5 @@ +# shellcheck disable=all + # # --region the AWS Region to send the command # --function-name the name of your function diff --git a/scripts/integration_tests.sh b/scripts/integration_tests.sh index 232d743d..cb0e031b 100755 --- a/scripts/integration_tests.sh +++ b/scripts/integration_tests.sh @@ -22,13 +22,10 @@ fatal() { error "$@"; exit 1; } test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset" test -n "${COMMAND:-}" || fatal "COMMAND unset" test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset" -swift_version="$SWIFT_VERSION" -command="$COMMAND" -example="$EXAMPLE" -pushd Examples/"$example" > /dev/null +pushd Examples/"$EXAMPLE" > /dev/null log "Running command with Swift $SWIFT_VERSION" -eval "$command" +eval "$COMMAND" popd diff --git a/scripts/linux_performance_setup.sh b/scripts/linux_performance_setup.sh index 7c11cbbd..f02ac66b 100755 --- a/scripts/linux_performance_setup.sh +++ b/scripts/linux_performance_setup.sh @@ -20,14 +20,14 @@ apt-get install -y vim htop strace linux-tools-common linux-tools-generic libc6- echo 0 > /proc/sys/kernel/kptr_restrict -cd /usr/bin +pushd /usr/bin || exit 1 rm -rf perf ln -s /usr/lib/linux-tools/*/perf perf -cd - +popd || exit 1 -cd /opt +pushd /opt || exit 1 git clone https://github.com/brendangregg/FlameGraph.git -cd - +popd || exit 1 # build the code in relase mode with debug symbols # swift build -c release -Xswiftc -g diff --git a/scripts/performance_test.sh b/scripts/performance_test.sh index 65c2c244..e4157cb0 100755 --- a/scripts/performance_test.sh +++ b/scripts/performance_test.sh @@ -27,8 +27,8 @@ if [[ $(uname -s) == "Linux" ]]; then fi swift build -c release -Xswiftc -g -swift build --package-path Examples/Echo -c release -Xswiftc -g -swift build --package-path Examples/JSON -c release -Xswiftc -g +LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloWorld -c release -Xswiftc -g +LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloJSON -c release -Xswiftc -g cleanup() { kill -9 $server_pid # ignore-unacceptable-language @@ -58,24 +58,24 @@ kill -0 $server_pid # check server is alive # ignore-unacceptable-language echo "running $MODE mode cold test" cold=() export MAX_REQUESTS=1 -for (( i=0; i<$cold_iterations; i++ )); do +for (( i=0; i