name: Tests

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master/stable branch
  push:
    branches: [ master, stable ]
  pull_request:
    branches: [ master, stable ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [20.x]

    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: yarn

      - name: Install dependencies
        run: yarn install --frozen-lockfile

      - name: Test
        run: yarn test:mocha

      - name: Integration Test
        run: yarn test:integration
