name: Test

on:
  pull_request:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref }}
  cancel-in-progress: true

permissions:
  checks: write
  contents: read
  pull-requests: read

jobs:
  test:
    runs-on: ubuntu-22.04
    timeout-minutes: 5
    steps:
      - name: Check out Git repository
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          ref: ${{ github.event.pull_request.head.sha || github.ref }}

      - name: Install Node and npm packages
        uses: ./.github/actions/setup-node-env

      - name: Run tests
        run: yarn test

      - name: Check export map
        run: yarn test:export
