name: CI

# v2022-07-13 [rivy]
# spell-checker:ignore (names) MacOS deps ; (people) Roy Ivy III * rivy

on: [push]

jobs:
  build:
    name: Build
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]
        node-version: [10.x, 12.x, 14.x, 16.x, 18.x]

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm run show:deps
      - run: npm run build --if-present
      - run: npm test
        env:
          CI: true
      - run: npm run coverage "--cov-send=--flags=${{ matrix.os }}"
