name: JS on: workflow_dispatch: push: paths: - mlflow/server/js/** - .github/actions/check-component-ids/** - .github/workflows/js.yml branches: - master - branch-[0-9]+.[0-9]+ pull_request: types: - opened - synchronize - reopened paths: - mlflow/server/js/** - .github/actions/check-component-ids/** - .github/workflows/js.yml concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true defaults: run: shell: bash permissions: {} jobs: check-component-ids: if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false || github.event.pull_request.user.login == 'Copilot' && github.event.pull_request.user.type == 'Bot') permissions: contents: read timeout-minutes: 5 runs-on: ubuntu-slim steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Check componentId registry uses: ./.github/actions/check-component-ids js: if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false || github.event.pull_request.user.login == 'Copilot' && github.event.pull_request.user.type == 'Bot') permissions: contents: read timeout-minutes: 30 strategy: fail-fast: false matrix: option: [--testPathPattern, --testPathIgnorePatterns] runs-on: ubuntu-latest defaults: run: working-directory: mlflow/server/js steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - uses: ./.github/actions/setup-node - name: Install dependencies run: | yarn install --immutable - name: Run lint run: | yarn lint - name: Run prettier run: | yarn prettier:check # TODO: Disabled for now. Revisit after DAIS. # - name: Run knip # run: | # yarn knip - name: Run extract-i18n lint run: | yarn i18n:check - name: Run type-check run: | yarn type-check - name: Run tests env: MATRIX_OPTION: ${{ matrix.option }} # --maxWorkers=2: Jest's default (3) leaks module cache across test # files and peaks ~15 GB RSS on the 16 GB runner; 2 keeps peak ~13 GB. run: | "$GITHUB_WORKSPACE/dev/profile.sh" \ yarn test --silent --maxWorkers=2 $MATRIX_OPTION src/experiment-tracking/components - name: Upload profile metrics if: always() uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: profile-metrics-${{ strategy.job-index }} path: /tmp/profile-metrics.csv # TODO: Uncomment once `gh run download` supports non-zipped artifacts. # https://github.com/cli/cli/issues/13012 # archive: false retention-days: 3 if-no-files-found: ignore - name: Run build run: | yarn build