Skip to content

Add update-snapshots github action #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: update-snapshots

on:
schedule:
- cron: "0 15 * * *" # every day 11am EST

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node 14
uses: actions/setup-node@v3
with:
node-version: 14

- name: Cache Node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Python dependencies
run: |
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install .[dev]

- name: Install Serverless Framework
run: sudo yarn global add serverless@^3.7.0 --prefix /usr/local
- name: Install Crossbuild Deps
run: |
sudo apt-get update --allow-releaseinfo-change --fix-missing
sudo apt install -y qemu-user-static binfmt-support

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
working-directory: tests/integration
run: yarn install

- name: Update Snapshots
env:
UPDATE_SNAPSHOTS: true
BUILD_LAYERS: true
DD_API_KEY: ${{ secrets.DD_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: ./scripts/run_integration_tests.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: update snapshots
title: Update Snapshots
body: |
Autogenerated PR to update integration test snapshots. Make sure no difference when run in local environment before merging.
branch: update-snapshots
6 changes: 5 additions & 1 deletion scripts/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ fi

if [ -n "$BUILD_LAYERS" ]; then
echo "Building layers that will be deployed with our test functions"
PYTHON_VERSION=${!BUILD_LAYER_VERSION} source $scripts_dir/build_layers.sh
if [ -n "$BUILD_LAYER_VERSION" ]; then
PYTHON_VERSION=${!BUILD_LAYER_VERSION} source $scripts_dir/build_layers.sh
else
source $scripts_dir/build_layers.sh
fi
else
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'"
fi
Expand Down