name: Test

on:
  pull_request:
    branches:
      - main
  schedule:
    - cron: '0 22 * * 3'
  workflow_call:

permissions:
  contents: read

jobs:
  test:
    name: Test
    strategy:
      fail-fast: false
      matrix:
        node-version:
          - 22.12.x
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
      - name: Setup Node.js
        uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
        with:
          node-version: "${{ matrix.node-version }}"
          cache: 'yarn'
      - name: Install
        run: yarn install --immutable
      - name: Build
        run: yarn build
      - name: Lint
        run: yarn lint
      - name: Test
        run: yarn test
