@@ -95,10 +95,13 @@ jobs:
9595 echo "EOF" >> $GITHUB_OUTPUT
9696 echo "Function name map: $FUNCTION_NAME_MAP"
9797
98- cleanup :
99- needs : [ deploy]
98+ test :
99+ needs : deploy
100100 runs-on : ubuntu-latest
101- if : always()
101+ strategy :
102+ matrix :
103+ example : ${{ fromJson(needs.deploy.outputs.function-name-map) }}
104+ fail-fast : false
102105
103106 steps :
104107 - uses : actions/checkout@v4
@@ -123,6 +126,83 @@ jobs:
123126 role-session-name : pythonTestingLibraryGitHubIntegrationTest
124127 aws-region : ${{ env.AWS_REGION }}
125128
129+ - name : Invoke Lambda function
130+ env :
131+ LAMBDA_ENDPOINT : ${{ secrets.LAMBDA_ENDPOINT }}
132+ FUNCTION_NAME : ${{ matrix.example }}
133+ run : |
134+ echo "Testing function: $FUNCTION_NAME"
135+ aws lambda invoke \
136+ --function-name "$FUNCTION_NAME" \
137+ --cli-binary-format raw-in-base64-out \
138+ --payload '{"name": "World"}' \
139+ --region "${{ env.AWS_REGION }}" \
140+ --endpoint-url "$LAMBDA_ENDPOINT" \
141+ /tmp/response.json
142+ echo "Response:"
143+ cat /tmp/response.json
144+
145+ - name : Find Durable Execution
146+ env :
147+ LAMBDA_ENDPOINT : ${{ secrets.LAMBDA_ENDPOINT }}
148+ FUNCTION_NAME : ${{ matrix.example }}
149+ run : |
150+ echo "Listing durable executions for function: $FUNCTION_NAME"
151+ aws lambda list-durable-executions \
152+ --function-name "$FUNCTION_NAME" \
153+ --region "${{ env.AWS_REGION }}" \
154+ --endpoint-url "$LAMBDA_ENDPOINT" \
155+ --cli-binary-format raw-in-base64-out \
156+ --status-filter SUCCEEDED \
157+ > /tmp/executions.json
158+ echo "Durable Executions:"
159+ cat /tmp/executions.json
160+
161+ # Extract the first execution ARN for history retrieval
162+ EXECUTION_ARN=$(jq -r '.DurableExecutions[0].DurableExecutionArn // empty' /tmp/executions.json)
163+ echo "EXECUTION_ARN=$EXECUTION_ARN" >> $GITHUB_ENV
164+
165+ - name : Get Durable Execution History
166+ if : env.EXECUTION_ARN != ''
167+ env :
168+ LAMBDA_ENDPOINT : ${{ secrets.LAMBDA_ENDPOINT }}
169+ run : |
170+ echo "Getting execution history for: $EXECUTION_ARN"
171+ aws lambda get-durable-execution-history \
172+ --durable-execution-arn "$EXECUTION_ARN" \
173+ --region "${{ env.AWS_REGION }}" \
174+ --endpoint-url "$LAMBDA_ENDPOINT" \
175+ --cli-binary-format raw-in-base64-out \
176+ > /tmp/history.json
177+ echo "Execution History:"
178+ cat /tmp/history.json
179+
180+ cleanup :
181+ needs : [deploy, test]
182+ runs-on : ubuntu-latest
183+ if : always()
184+
185+ steps :
186+ - uses : actions/checkout@v4
187+
188+ - name : Setup SSH Agent
189+ uses : webfactory/ssh-agent@v0.9.0
190+ with :
191+ ssh-private-key : ${{ secrets.SDK_KEY }}
192+
193+ - name : Setup Python
194+ uses : actions/setup-python@v4
195+ with :
196+ python-version : ' 3.13'
197+
198+ - name : Configure AWS credentials
199+ if : github.event_name != 'workflow_dispatch' || github.actor != 'nektos/act'
200+ uses : aws-actions/configure-aws-credentials@v4
201+ with :
202+ role-to-assume : " ${{ secrets.ACTIONS_INTEGRATION_ROLE_NAME }}"
203+ role-session-name : pythonTestingLibraryGitHubIntegrationTest
204+ aws-region : ${{ env.AWS_REGION }}
205+
126206 - name : Install Hatch
127207 run : pip install hatch
128208
0 commit comments