# GitHub actions
# https://docs.github.com/en/free-pro-team@latest/actions

name: ci-test

on: [push, pull_request]

jobs:
  test:

    runs-on: ubuntu-20.04

    strategy:
      matrix:
        node_version: [10.14.2, 14.x, 15.x, 16.x, 17.x]

    steps:
    - uses: actions/checkout@v2

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

    - name: setup timezone
      uses: zcong1993/setup-timezone@master
      with:
        timezone: ${{ secrets.TZ }}

    - name: run npm scripts
      run: |
        npm i -g standard
        npm install
        npm run lint
        npm run test

    - name: sync to coveralls
      uses: coverallsapp/github-action@v1.1.2
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

    - name: cache node modules
      uses: actions/cache@v2
      with:
        path: ~/.npm
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
        restore-keys: |
          ${{ runner.os }}-node-

# GitHub actions
# https://docs.github.com/en/free-pro-team@latest/actions

name: ci-test

on: [push, pull_request]

jobs:
  test:

    runs-on: ubuntu-20.04

    strategy:
      matrix:
        node_version: [14.x, 15.x, 16.x, 17.x]

    steps:
    - uses: actions/checkout@v2

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

    - name: setup timezone
      uses: zcong1993/setup-timezone@master
      with:
        timezone: ${{ secrets.TZ }}

    - name: run npm scripts
      run: |
        npm i -g standard
        npm install
        npm run lint
        npm run test

    - name: sync to coveralls
      uses: coverallsapp/github-action@v1.1.2
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

    - name: cache node modules
      uses: actions/cache@v2
      with:
        path: ~/.npm
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
        restore-keys: |
          ${{ runner.os }}-node-

Remove test from node < 14
Remove test from node < 14
