name: main
on:
  - pull_request
  - push
jobs:
  small:
    name: test / ${{matrix.os}} / ${{matrix.node}}
    runs-on: ${{matrix.os}}
    env:
      PUPPETEER_SKIP_DOWNLOAD: 1
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v2
        with:
          node-version: ${{matrix.node}}
          cache: npm
      - run: npm install -g npm && npm install
      - run: npm run test-api
    strategy:
      matrix:
        os:
          - macos-latest
          - windows-latest
        node:
          - '*'
        include:
          - os: ubuntu-latest
            node: lts/erbium
  full:
    name: full build
    runs-on: ubuntu-latest
    env:
      PUPPETEER_SKIP_DOWNLOAD: 1
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v2
        with:
          node-version: '*'
          cache: npm
      - run: npm install -g npm && npm install
      - run: npm test
      - uses: codecov/codecov-action@v2
