forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.96 KB
/
lambda-runtime-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Lambda Runtime Tests Update
on:
pull_request:
paths:
- 'packages/aws-cdk-lib/aws-lambda/lib/runtime.ts'
jobs:
update-lambda-tests:
if: github.repository == 'aws/aws-cdk'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "*"
env:
NODE_OPTIONS: "--max-old-space-size=8196 --experimental-worker ${NODE_OPTIONS:-}"
- name: Install dependencies
run: yarn install --frozen-lockfile && cd tools/@aws-cdk/lambda-integration-test-updater && yarn build+test
- name: Update Lambda Runtime Tests
run: |
cd tools/@aws-cdk/lambda-integration-test-updater
./bin/update-lambda-runtimestes-integ-testing
- name: Check for changes
id: git-check
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit & Push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --global user.name 'aws-cdk-automation'
git config --global user.email 'aws-cdk-automation@users.noreply.github.com'
git fetch origin ${{ github.event.pull_request.head.ref }}
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/${{ github.event.pull_request.head.ref }})" ]; then
echo "Remote branch updated since approved commit; aborting."
exit 1
fi
git checkout -B ${{ github.event.pull_request.head.ref }}
git add .
git commit -m "chore: update lambda runtime integration tests"
git push origin ${{ github.event.pull_request.head.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}