* disable yaml linter

* add semver label check

* re-enable soundness checks (shell, python, and yaml)

* disable checks on docc shell command

* fix errors
This commit is contained in:
Sébastien Stormacq
2024-11-26 18:32:24 +01:00
committed by GitHub
parent 21e224ea8d
commit 64a4d829f0
23 changed files with 72 additions and 29 deletions
+15 -2
View File
@@ -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:
@@ -1,2 +1,3 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
@@ -1,3 +1,4 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
# create a skeleton project
@@ -1,3 +1,4 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
# create a skeleton project
@@ -1,3 +1,4 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
# create a skeleton project
@@ -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))
@@ -1,3 +1,5 @@
# shellcheck disable=all
curl --header "Content-Type: application/json" \
--request POST \
--data '{"number": 3}' \
@@ -1,3 +1,5 @@
# shellcheck disable=all
curl --header "Content-Type: application/json" \
--request POST \
--data '{"number": 3}' \
@@ -1,2 +1,3 @@
export LOCAL_LAMBDA_SERVER_ENABLED=true
# shellcheck disable=all
export LOCAL_LAMBDA_SERVER_ENABLED=true
@@ -1,2 +1,4 @@
# shellcheck disable=all
export LOCAL_LAMBDA_SERVER_ENABLED=true
swift run
@@ -1,3 +1,5 @@
# shellcheck disable=all
export LOCAL_LAMBDA_SERVER_ENABLED=true
swift run
@@ -1,2 +1,4 @@
# shellcheck disable=all
swift package archive --allow-network-connections docker
@@ -1,3 +1,5 @@
# shellcheck disable=all
swift package archive --allow-network-connections docker
-------------------------------------------------------------------------
@@ -1,3 +1,5 @@
# shellcheck disable=all
swift package archive --allow-network-connections docker
-------------------------------------------------------------------------
@@ -1 +1,3 @@
# shellcheck disable=all
aws --version
@@ -1,3 +1,5 @@
# shellcheck disable=all
#
# --region the AWS Region to send the command
# --function-name the name of your function
@@ -1,3 +1,5 @@
# shellcheck disable=all
#
# --region the AWS Region to send the command
# --function-name the name of your function
@@ -1,3 +1,5 @@
# shellcheck disable=all
#
# --region the AWS Region to send the command
# --function-name the name of your function
@@ -1,3 +1,5 @@
# shellcheck disable=all
#
# --region the AWS Region to send the command
# --function-name the name of your function
@@ -1,3 +1,5 @@
# shellcheck disable=all
#
# --region the AWS Region to send the command
# --function-name the name of your function
+2 -5
View File
@@ -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
+4 -4
View File
@@ -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
+17 -17
View File
@@ -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<cold_iterations; i++ )); do
start=$(gdate +%s%N)
./Examples/Echo/.build/release/MyLambda
./Examples/HelloWorld/.build/release/MyLambda
end=$(gdate +%s%N)
cold+=( $(($end-$start)) )
cold+=( $((end-start)) )
done
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
avg_cold=$(($sum_cold/$cold_iterations))
avg_cold=$((sum_cold/cold_iterations))
results+=( "$MODE, cold: $avg_cold (ns)" )
# normal calls
echo "running $MODE mode warm test"
export MAX_REQUESTS=$warm_iterations
start=$(gdate +%s%N)
./Examples/Echo/.build/release/MyLambda
./Examples/HelloWorld/.build/release/MyLambda
end=$(gdate +%s%N)
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
results+=( "$MODE, warm: $avg_warm (ns)" )
#------------------
@@ -96,24 +96,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<cold_iterations; i++ )); do
start=$(gdate +%s%N)
./Examples/JSON/.build/release/MyLambda
./Examples/HelloJSON/.build/release/MyLambda
end=$(gdate +%s%N)
cold+=( $(($end-$start)) )
cold+=( $((end-start)) )
done
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
avg_cold=$(($sum_cold/$cold_iterations))
avg_cold=$((sum_cold/cold_iterations))
results+=( "$MODE, cold: $avg_cold (ns)" )
# normal calls
echo "running $MODE mode warm test"
export MAX_REQUESTS=$warm_iterations
start=$(gdate +%s%N)
./Examples/JSON/.build/release/MyLambda
./Examples/HelloJSON/.build/release/MyLambda
end=$(gdate +%s%N)
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
results+=( "$MODE, warm: $avg_warm (ns)" )
# print results
@@ -121,7 +121,7 @@ echo "-----------------------------"
echo "results"
echo "-----------------------------"
for i in "${results[@]}"; do
echo $i
echo "$i"
done
echo "-----------------------------"