name: Test

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["**"]
  # Run the workflow regularly, as auto-merged PRs by bots may not trigger it.
  schedule:
    - cron: "0 0 1,15 * *"
  # Allow manual triggering of the workflow.
  workflow_dispatch:

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        node-version: ["22", "24", "26"]
    uses: ybiquitous/.github/.github/workflows/nodejs-test-reusable.yml@3a3a3f01f06fd4c0f834f5df53dc3b38c493d007 # v3.3.1
    with:
      node-version: ${{ matrix.node-version }}
      node-version-coverage: "26"
      node-version-snapshot: "24"
    permissions:
      contents: write

  lint:
    uses: ybiquitous/.github/.github/workflows/nodejs-lint-reusable.yml@3a3a3f01f06fd4c0f834f5df53dc3b38c493d007 # v3.3.1
    permissions:
      contents: read
