name: JS

on:
  pull_request:
    paths:
      - .github/workflows/js.yml
      - bin/web*
      - web/app/**

permissions:
  contents: read

jobs:
  js-web-test:
    timeout-minutes: 30
    runs-on: ${{ vars.LINKERD2_RUNNER || 'ubuntu-24.04' }}
    container:
      image: node:20-bookworm
    env:
      NODE_ENV: test
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
      - name: Yarn setup
        shell: bash
        run: |
          bin/scurl --retry 2 https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1 --network-concurrency 1
          echo PATH="$HOME/.yarn/bin:$PATH" >> "$GITHUB_ENV"
      - run: bin/web --frozen-lockfile
      - run: bin/web test --reporters="jest-progress-bar-reporter" --reporters="./gh_ann_reporter.js"
