Skip to content

Commit 64a4d82

Browse files
authored
Fix CI (#429)
* disable yaml linter * add semver label check * re-enable soundness checks (shell, python, and yaml) * disable checks on docc shell command * fix errors
1 parent 21e224e commit 64a4d82

23 files changed

+72
-29
lines changed

.github/workflows/pull_request.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ jobs:
1010
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
1111
with:
1212
license_header_check_project_name: "SwiftAWSLambdaRuntime"
13-
shell_check_enabled: false
14-
python_lint_check_enabled: false
13+
shell_check_enabled: true
14+
python_lint_check_enabled: true
1515
api_breakage_check_container_image: "swift:6.0-noble"
1616
docs_check_container_image: "swift:6.0-noble"
1717
format_check_container_image: "swiftlang/swift:nightly-6.0-jammy"
18+
yamllint_check_enabled: true
1819

1920
unit-tests:
2021
name: Unit tests
@@ -43,6 +44,18 @@ jobs:
4344
name: Swift 6 Language Mode
4445
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
4546

47+
semver-label-check:
48+
name: Semantic Version label check
49+
runs-on: ubuntu-latest
50+
timeout-minutes: 1
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
with:
55+
persist-credentials: false
56+
- name: Check for Semantic Version label
57+
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main
58+
4659
# until there is a support for musl in swiftlang/github-workflows
4760
# https://github.com/swiftlang/github-workflows/issues/34
4861
musl:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# shellcheck disable=all
12
# Create a project directory
23
mkdir SquareNumber && cd SquareNumber

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-02-package-init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# shellcheck disable=all
12
# Create a project directory
23
mkdir SquareNumber && cd SquareNumber
34
# create a skeleton project

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-03-package-init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# shellcheck disable=all
12
# Create a project directory
23
mkdir SquareNumber && cd SquareNumber
34
# create a skeleton project

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-04-package-init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# shellcheck disable=all
12
# Create a project directory
23
mkdir SquareNumber && cd SquareNumber
34
# create a skeleton project

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-03-console-output.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
2023-04-14T11:42:21+0200 info LocalLambdaServer : [AWSLambdaRuntimeCore] LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke
24
2023-04-14T11:42:21+0200 info Lambda : [AWSLambdaRuntimeCore] lambda runtime starting with LambdaConfiguration
35
General(logLevel: info))

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-04-curl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
curl --header "Content-Type: application/json" \
24
--request POST \
35
--data '{"number": 3}' \

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-05-curl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
curl --header "Content-Type: application/json" \
24
--request POST \
35
--data '{"number": 3}' \
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
export LOCAL_LAMBDA_SERVER_ENABLED=true
1+
# shellcheck disable=all
22

3+
export LOCAL_LAMBDA_SERVER_ENABLED=true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# shellcheck disable=all
2+
13
export LOCAL_LAMBDA_SERVER_ENABLED=true
24
swift run

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-08-terminal.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
export LOCAL_LAMBDA_SERVER_ENABLED=true
24
swift run
35

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# shellcheck disable=all
2+
13
swift package archive --allow-network-connections docker
24

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-03-plugin-archive.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
swift package archive --allow-network-connections docker
24

35
-------------------------------------------------------------------------

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-04-plugin-archive.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
swift package archive --allow-network-connections docker
24

35
-------------------------------------------------------------------------
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# shellcheck disable=all
2+
13
aws --version

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke-hidden.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
#
24
# --region the AWS Region to send the command
35
# --function-name the name of your function

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
#
24
# --region the AWS Region to send the command
35
# --function-name the name of your function

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-03-lambda-invoke.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
#
24
# --region the AWS Region to send the command
35
# --function-name the name of your function

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-04-lambda-invoke.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
#
24
# --region the AWS Region to send the command
35
# --function-name the name of your function

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-05-lambda-invoke.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# shellcheck disable=all
2+
13
#
24
# --region the AWS Region to send the command
35
# --function-name the name of your function

scripts/integration_tests.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ fatal() { error "$@"; exit 1; }
2222
test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset"
2323
test -n "${COMMAND:-}" || fatal "COMMAND unset"
2424
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"
25-
swift_version="$SWIFT_VERSION"
26-
command="$COMMAND"
27-
example="$EXAMPLE"
2825

29-
pushd Examples/"$example" > /dev/null
26+
pushd Examples/"$EXAMPLE" > /dev/null
3027

3128
log "Running command with Swift $SWIFT_VERSION"
32-
eval "$command"
29+
eval "$COMMAND"
3330

3431
popd

scripts/linux_performance_setup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ apt-get install -y vim htop strace linux-tools-common linux-tools-generic libc6-
2020

2121
echo 0 > /proc/sys/kernel/kptr_restrict
2222

23-
cd /usr/bin
23+
pushd /usr/bin || exit 1
2424
rm -rf perf
2525
ln -s /usr/lib/linux-tools/*/perf perf
26-
cd -
26+
popd || exit 1
2727

28-
cd /opt
28+
pushd /opt || exit 1
2929
git clone https://github.com/brendangregg/FlameGraph.git
30-
cd -
30+
popd || exit 1
3131

3232
# build the code in relase mode with debug symbols
3333
# swift build -c release -Xswiftc -g

scripts/performance_test.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ if [[ $(uname -s) == "Linux" ]]; then
2727
fi
2828

2929
swift build -c release -Xswiftc -g
30-
swift build --package-path Examples/Echo -c release -Xswiftc -g
31-
swift build --package-path Examples/JSON -c release -Xswiftc -g
30+
LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloWorld -c release -Xswiftc -g
31+
LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloJSON -c release -Xswiftc -g
3232

3333
cleanup() {
3434
kill -9 $server_pid # ignore-unacceptable-language
@@ -58,24 +58,24 @@ kill -0 $server_pid # check server is alive # ignore-unacceptable-language
5858
echo "running $MODE mode cold test"
5959
cold=()
6060
export MAX_REQUESTS=1
61-
for (( i=0; i<$cold_iterations; i++ )); do
61+
for (( i=0; i<cold_iterations; i++ )); do
6262
start=$(gdate +%s%N)
63-
./Examples/Echo/.build/release/MyLambda
63+
./Examples/HelloWorld/.build/release/MyLambda
6464
end=$(gdate +%s%N)
65-
cold+=( $(($end-$start)) )
65+
cold+=( $((end-start)) )
6666
done
6767
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
68-
avg_cold=$(($sum_cold/$cold_iterations))
68+
avg_cold=$((sum_cold/cold_iterations))
6969
results+=( "$MODE, cold: $avg_cold (ns)" )
7070

7171
# normal calls
7272
echo "running $MODE mode warm test"
7373
export MAX_REQUESTS=$warm_iterations
7474
start=$(gdate +%s%N)
75-
./Examples/Echo/.build/release/MyLambda
75+
./Examples/HelloWorld/.build/release/MyLambda
7676
end=$(gdate +%s%N)
77-
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
78-
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
77+
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
78+
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
7979
results+=( "$MODE, warm: $avg_warm (ns)" )
8080

8181
#------------------
@@ -96,32 +96,32 @@ kill -0 $server_pid # check server is alive # ignore-unacceptable-language
9696
echo "running $MODE mode cold test"
9797
cold=()
9898
export MAX_REQUESTS=1
99-
for (( i=0; i<$cold_iterations; i++ )); do
99+
for (( i=0; i<cold_iterations; i++ )); do
100100
start=$(gdate +%s%N)
101-
./Examples/JSON/.build/release/MyLambda
101+
./Examples/HelloJSON/.build/release/MyLambda
102102
end=$(gdate +%s%N)
103-
cold+=( $(($end-$start)) )
103+
cold+=( $((end-start)) )
104104
done
105105
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
106-
avg_cold=$(($sum_cold/$cold_iterations))
106+
avg_cold=$((sum_cold/cold_iterations))
107107
results+=( "$MODE, cold: $avg_cold (ns)" )
108108

109109
# normal calls
110110
echo "running $MODE mode warm test"
111111
export MAX_REQUESTS=$warm_iterations
112112
start=$(gdate +%s%N)
113-
./Examples/JSON/.build/release/MyLambda
113+
./Examples/HelloJSON/.build/release/MyLambda
114114
end=$(gdate +%s%N)
115-
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
116-
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
115+
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
116+
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
117117
results+=( "$MODE, warm: $avg_warm (ns)" )
118118

119119
# print results
120120
echo "-----------------------------"
121121
echo "results"
122122
echo "-----------------------------"
123123
for i in "${results[@]}"; do
124-
echo $i
124+
echo "$i"
125125
done
126126
echo "-----------------------------"
127127

0 commit comments

Comments
 (0)