name: 🔎 Test package
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
jobs:
  ubuntu_build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x, 12.x, 14.x, 15.x]
    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: Cache node modules
      uses: actions/cache@v2
      id: cache
      with:
        path: node_modules
        key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
    - name: Install package
      if: steps.cache.outputs.cache-hit != 'true'
      run: yarn install
    - name: Build TS
      run: yarn build
    - name: Test package
      run: yarn test
