Skip to content

Update Dependencies #1737

Update Dependencies

Update Dependencies #1737

Workflow file for this run

name: build
on:
push:
branches:
- 'main'
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node 16.14
uses: actions/setup-node@v3
with:
node-version: 16.14
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node modules from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
- name: Check formatting
run: yarn check-formatting
- name: Lint
run: yarn lint
unit-test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
node-version: [14.15, 16.14, 18.12]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node modules from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Run tests
run: yarn test
- name: Upload code coverage report
run: bash <(curl -s https://codecov.io/bash)
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
runtime-param: [14, 16, 18]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node 14
uses: actions/setup-node@v3
with:
node-version: 14
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Complete Buildx Setup
run: docker run --privileged --rm tonistiigi/binfmt --install all
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node modules from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Serverless Framework
run: sudo yarn global add serverless --prefix /usr/local
- name: Install dependencies
working-directory: integration_tests
run: yarn install
- name: Run tests
env:
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 }}
RUNTIME_PARAM: ${{ matrix.runtime-param }}
run: ./scripts/run_integration_tests.sh
- name: Send success metric
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
run: ./scripts/send_status_metric.sh 0 $DD_API_KEY
integration-test-failure:
runs-on: ubuntu-latest
needs: [integration-test]
if: always() && (needs.integration-test.result == 'failure')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Send a failure metric
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
run: ./scripts/send_status_metric.sh 1 $DD_API_KEY