name: Node.js CI

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      AUTH0_DOMAIN: fake-domain.auth0.com
      SENDGRID_API_KEY: SG.TEST_KEY
      SESSION_SECRET: test
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: '10.X'
      - name: Cache NPM
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Install
        run: npm ci
      - name: Lint
        run: npm run lint
      - name: Build
        run: npm run heroku-postbuild
      - name: Install MongoDB
        uses: supercharge/mongodb-github-action@1.3.0
        with:
          mongodb-version: '3.6'
      - name: Test
        run: npm run test
      - name: E2E Test
        uses: cypress-io/github-action@v1
        env:
          MONGODB_URI: 'mongodb://localhost/buddyduel-e2e'
          PORT: 3000
        with:
          start: npm start

name: Node.js CI

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      AUTH0_DOMAIN: fake-domain.auth0.com
      SENDGRID_API_KEY: SG.TEST_KEY
      SESSION_SECRET: test
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: '10.X'
      - name: Cache NPM
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Install
        run: npm ci
      - name: Lint
        run: npm run lint
      - name: Build
        run: npm run heroku-postbuild
      - name: Install MongoDB
        uses: supercharge/mongodb-github-action@1.3.0
        with:
          mongodb-version: '3.6'
      - name: Test
        run: npm run test
      - name: E2E Test
        uses: cypress-io/github-action@v2
        env:
          MONGODB_URI: 'mongodb://localhost/buddyduel-e2e'
          PORT: 3000
        with:
          start: npm start

Update Cypress GitHub action to v2
Update Cypress GitHub action to v2
