@@ -17,20 +17,17 @@ jobs:
1717 python-version : ["3.13"]
1818
1919 steps :
20- - name : Parse testing SDK branch from PR body
21- id : parse
22- run : |
23- # Look for a line like: TESTING_SDK_BRANCH: feature/foo
24- REF=$(printf '%s\n' '${{ github.event.pull_request.body }}' | sed -n 's/^TESTING_SDK_BRANCH:[[:space:]]*//p' | head -n1)
25- if [ -z "$REF" ]; then REF="main"; fi
26- echo "testing_ref=$REF" >> "$GITHUB_OUTPUT"
27- echo "Using testing SDK branch: $REF"
28-
2920 - name : Checkout Language SDK (this PR)
3021 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3122 with :
3223 path : language-sdk
3324
25+ - name : Parse testing SDK branch from PR body
26+ id : parse
27+ run : python language-sdk/ops/parse_sdk_branch.py
28+ env :
29+ PR_BODY : ${{ github.event.pull_request.body }}
30+
3431 - name : Checkout Testing SDK
3532 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3633 with :
@@ -67,22 +64,19 @@ jobs:
6764 if : github.event_name == 'pull_request'
6865 env :
6966 AWS_REGION : us-west-2
70-
71- steps :
72- - name : Parse testing SDK branch from PR body
73- id : parse
74- run : |
75- # Look for a line like: TESTING_SDK_BRANCH: feature/foo
76- REF=$(printf '%s\n' '${{ github.event.pull_request.body }}' | sed -n 's/^TESTING_SDK_BRANCH:[[:space:]]*//p' | head -n1)
77- if [ -z "$REF" ]; then REF="main"; fi
78- echo "testing_ref=$REF" >> "$GITHUB_OUTPUT"
79- echo "Using testing SDK branch: $REF"
8067
68+ steps :
8169 - name : Checkout Language SDK (this PR)
8270 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8371 with :
8472 path : language-sdk
8573
74+ - name : Parse testing SDK branch from PR body
75+ id : parse
76+ run : python language-sdk/ops/parse_sdk_branch.py
77+ env :
78+ PR_BODY : ${{ github.event.pull_request.body }}
79+
8680 - name : Checkout Testing SDK
8781 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8882 with :
@@ -133,20 +127,20 @@ jobs:
133127 run : |
134128 echo "Building examples..."
135129 hatch run examples:build
136-
130+
137131 # Get first integration example for testing
138132 EXAMPLE_NAME=$(echo '${{ steps.get-examples.outputs.examples }}' | jq -r '.[0].name')
139133 EXAMPLE_NAME_CLEAN=$(echo "$EXAMPLE_NAME" | sed 's/ //g')
140134 FUNCTION_NAME="${EXAMPLE_NAME_CLEAN}-LanguageSDK-PR-${{ github.event.number }}"
141-
135+
142136 echo "Deploying example: $EXAMPLE_NAME as $FUNCTION_NAME"
143137 hatch run examples:deploy "$EXAMPLE_NAME" --function-name "$FUNCTION_NAME"
144-
138+
145139 QUALIFIED_FUNCTION_NAME="$FUNCTION_NAME:\$LATEST"
146-
140+
147141 echo "Waiting for function to be ready..."
148142 aws lambda wait function-active --function-name "$FUNCTION_NAME" --endpoint-url "$LAMBDA_ENDPOINT" --region "${{ env.AWS_REGION }}"
149-
143+
150144 echo "Invoking Lambda function: $QUALIFIED_FUNCTION_NAME"
151145 aws lambda invoke \
152146 --function-name "$QUALIFIED_FUNCTION_NAME" \
@@ -156,18 +150,18 @@ jobs:
156150 --endpoint-url "$LAMBDA_ENDPOINT" \
157151 /tmp/response.json \
158152 > /tmp/invoke_response.json
159-
153+
160154 echo "Response:"
161155 cat /tmp/response.json
162-
156+
163157 # Check for function errors
164158 FUNCTION_ERROR=$(jq -r '.FunctionError // empty' /tmp/invoke_response.json)
165159 if [ -n "$FUNCTION_ERROR" ]; then
166160 echo "ERROR: Lambda function failed with error: $FUNCTION_ERROR"
167161 cat /tmp/response.json
168162 exit 1
169163 fi
170-
164+
171165 echo "Getting durable executions..."
172166 aws lambda list-durable-executions-by-function \
173167 --function-name "$QUALIFIED_FUNCTION_NAME" \
@@ -176,15 +170,13 @@ jobs:
176170 --endpoint-url "$LAMBDA_ENDPOINT" \
177171 --cli-binary-format raw-in-base64-out \
178172 > /tmp/executions.json
179-
173+
180174 echo "Durable Executions:"
181175 cat /tmp/executions.json
182-
176+
183177 # Cleanup
184178 echo "Cleaning up function: $FUNCTION_NAME"
185179 aws lambda delete-function \
186180 --function-name "$FUNCTION_NAME" \
187181 --endpoint-url "$LAMBDA_ENDPOINT" \
188182 --region "${{ env.AWS_REGION }}" || echo "Function cleanup failed or already deleted"
189-
190-
0 commit comments