Skip to content

Commit 5f7fb55

Browse files
authored
Merge branch 'main' into joey/integration_tests
2 parents 771d705 + 3a579c6 commit 5f7fb55

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: update-snapshots
2+
3+
on:
4+
schedule:
5+
- cron: "0 15 * * *" # every day 11am EST
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Set up Node 14
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 14
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v2
22+
23+
- name: Complete Buildx Setup
24+
run: docker run --privileged --rm tonistiigi/binfmt --install all
25+
26+
- name: Get yarn cache directory path
27+
id: yarn-cache-dir-path
28+
run: echo "::set-output name=dir::$(yarn cache dir)"
29+
30+
- name: Restore node modules from cache
31+
id: cache-node-modules
32+
uses: actions/cache@v3
33+
with:
34+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
35+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-yarn-
38+
39+
- name: Install Serverless Framework
40+
run: sudo yarn global add serverless --prefix /usr/local
41+
42+
- name: Install dependencies
43+
working-directory: integration_tests
44+
run: yarn install
45+
46+
- name: Update Snapshots
47+
env:
48+
UPDATE_SNAPSHOTS: true
49+
BUILD_LAYERS: true
50+
DD_API_KEY: ${{ secrets.DD_API_KEY }}
51+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
run: ./scripts/run_integration_tests.sh
54+
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v3
57+
with:
58+
commit-message: update snapshots
59+
title: Update Snapshots
60+
body: |
61+
Autogenerated PR to update integration test snapshots. Make sure no difference when run in local environment before merging.
62+
branch: update-snapshots

scripts/run_integration_tests.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ fi
6060

6161
if [ -n "$BUILD_LAYERS" ]; then
6262
echo "Building layers that will be deployed with our test functions"
63-
NODE_VERSION=${!BUILD_LAYER_VERSION} source $scripts_dir/build_layers.sh
63+
if [ -n "$BUILD_LAYER_VERSION" ]; then
64+
NODE_VERSION=${!BUILD_LAYER_VERSION} source $scripts_dir/build_layers.sh
65+
else
66+
source $scripts_dir/build_layers.sh
67+
fi
6468
else
6569
echo "Not building layers, ensure they've already been built or re-run with 'BUILD_LAYERS=true DD_API_KEY=XXXX ./scripts/run_integration_tests.sh'"
6670
fi

0 commit comments

Comments
 (0)