# This workflow will do a clean install of node dependencies, cache/restore them, 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: Tests

on:
  push:
    branches:
      - "main"
      - "fix/*"
      - "feature/*"
    paths-ignore:
      - "**.md"
  pull_request:
    types: [opened, synchronize, closed]
    paths-ignore:
      - "**.md"

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

    strategy:
      matrix:
        os:
          - ubuntu-latest
          - windows-latest
          - macos-latest
        node-version:
          - 16.x
          - 18.x
          - 20.x

    steps:
      - uses: actions/checkout@v4
      - name: Use Node ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm run test:pretty
