Skip to content

CI

CI #1564

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 14
- 16
- 18
- 20
serverless:
- "2.36.0"
- "2"
- "latest"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package.json') }}
- run: npm i
- run: npm i serverless@${{ matrix.serverless }}
- run: npm i @serverless/test@8
# Only install @serverless/test@8 for Serverless v2
if: matrix.serverless != 'latest'
- name: Run jest unit tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm test
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- run: npm i
- run: npm run check-format
- run: npm run lint
type:
name: Type
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- run: npm i
- name: Typescript checks
run: tsc --noEmit