# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [10.19, 12.4, 12.8, 13.11, 14.3, 14, 15]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: ./scripts/check-yarn-bug.sh
    - run: yarn
    - run: yarn test

  build_10_0:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js 10.19
      uses: actions/setup-node@v1
      with:
        node-version: 10.19
    - run: YARN_NODE_LINKER=node-modules yarn
    - name: Use Node.js 10.0
      uses: actions/setup-node@v1
      with:
        node-version: "10.0"
    - run: YARN_NODE_LINKER=node-modules YARN_IGNORE_NODE=1 yarn test
