Skip to content

Commit 9185094

Browse files
committed
Add the deploy workflow for the log uploader lambdas
**Impact:** CI on changes under the two new lambda directories **Risk:** low ## What Tests `gha-log-uploader` and `call-log-classifier` on every PR that touches either directory, and runs `make deploy` for both on pushes to main. Modelled on `github-status-test-lambda.yml`. ghstack-source-id: 377027b Pull-Request: #8593
1 parent 4f07028 commit 9185094

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test and deploy gha-log-uploader
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- ".github/workflows/gha-log-uploader-lambda.yml"
9+
- "aws/lambda/gha-log-uploader/**"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/gha-log-uploader-lambda.yml"
13+
- "aws/lambda/gha-log-uploader/**"
14+
15+
defaults:
16+
run:
17+
working-directory: aws/lambda/gha-log-uploader/
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
25+
with:
26+
python-version: '3.12'
27+
cache: pip
28+
- run: pip3 install -r requirements.txt pytest
29+
- run: pytest -v test_lambda_function.py
30+
31+
deploy:
32+
needs: test
33+
runs-on: ubuntu-latest
34+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
35+
permissions:
36+
id-token: write
37+
contents: read
38+
steps:
39+
- name: configure aws credentials
40+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
41+
with:
42+
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_gha-log-uploader-lambda
43+
aws-region: us-east-1
44+
45+
- name: Check out test infra
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
48+
- name: Setup python
49+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
50+
51+
- uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482 # v2.8.2
52+
name: Setup dependencies
53+
with:
54+
shell: bash
55+
timeout_minutes: 10
56+
max_attempts: 3
57+
retry_wait_seconds: 30
58+
command: |
59+
set -eux
60+
python3 -m pip install awscli
61+
62+
- name: Deploy the lambda
63+
run: make deploy

0 commit comments

Comments
 (0)