name: CI

on:
  push:
    branches:
      - master
    tags:
      - '*'

  pull_request:
    types: [opened, synchronize, reopened]
    
jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        node: ['10.x', '12.x']
        os: [ubuntu-latest, windows-latest, macOS-latest]

    name: Test on node ${{ matrix.node }} and ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v1

      - name: Use Node.js ${{ matrix.node }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node }}

      - name: Install yarn package manager
        run: npm install -g yarn

      - name: Install deps and build
        run: yarn install --frozen-lockfile

      - name: Run tests
        run: yarn test --runInBand --no-cache --coverage

name: CI

on:
  push:
    branches:
      - master
    tags:
      - '*'

  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        node: ['10.x', '12.x']
        os: [ubuntu-latest, windows-latest, macOS-latest]

    name: Test on node ${{ matrix.node }} and ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v1

      - name: Use Node.js ${{ matrix.node }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node }}

      - uses: actions/cache@v1
        with:
          path: ~/.cache/yarn
          key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Install deps, build, and test
        run: |
          node --version
          npm --version
          yarn --version        
          yarn install --frozen-lockfile
          yarn test --coverage
        env:
          CI: true
          NODE_OPTIONS: --max-old-space-size=4096
Add yarn caching, and allow for PR testing
Add yarn caching, and allow for PR testing
