Skip to content

Commit aab9a0d

Browse files
committed
Add update-snapshots github action (#257)
* Add update-snapshots github action
1 parent cddc194 commit aab9a0d

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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: Cache Node modules
20+
id: cache-node-modules
21+
uses: actions/cache@v3
22+
with:
23+
path: "**/node_modules"
24+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: 3.9
30+
31+
- name: Install Python dependencies
32+
run: |
33+
pip install virtualenv
34+
virtualenv venv
35+
source venv/bin/activate
36+
pip install .[dev]
37+
38+
- name: Install Serverless Framework
39+
run: sudo yarn global add serverless@^3.7.0 --prefix /usr/local
40+
- name: Install Crossbuild Deps
41+
run: |
42+
sudo apt-get update --allow-releaseinfo-change --fix-missing
43+
sudo apt install -y qemu-user-static binfmt-support
44+
45+
- name: Install dependencies
46+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
47+
working-directory: tests/integration
48+
run: yarn install
49+
50+
- name: Update Snapshots
51+
env:
52+
UPDATE_SNAPSHOTS: true
53+
BUILD_LAYERS: true
54+
DD_API_KEY: ${{ secrets.DD_API_KEY }}
55+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
56+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
57+
run: ./scripts/run_integration_tests.sh
58+
59+
- name: Create Pull Request
60+
uses: peter-evans/create-pull-request@v3
61+
with:
62+
commit-message: update snapshots
63+
title: Update Snapshots
64+
body: |
65+
Autogenerated PR to update integration test snapshots. Make sure no difference when run in local environment before merging.
66+
branch: update-snapshots

scripts/run_integration_tests.sh

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

6262
if [ -n "$BUILD_LAYERS" ]; then
6363
echo "Building layers that will be deployed with our test functions"
64-
PYTHON_VERSION=${!BUILD_LAYER_VERSION} source $scripts_dir/build_layers.sh
64+
if [ -n "$BUILD_LAYER_VERSION" ]; then
65+
PYTHON_VERSION=${!BUILD_LAYER_VERSION} source $scripts_dir/build_layers.sh
66+
else
67+
source $scripts_dir/build_layers.sh
68+
fi
6569
else
6670
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'"
6771
fi

0 commit comments

Comments
 (0)