Skip to content

perf(cli): parallelize scenario run fetching and name resolution in bmj logs #576

perf(cli): parallelize scenario run fetching and name resolution in bmj logs

perf(cli): parallelize scenario run fetching and name resolution in bmj logs #576

Workflow file for this run

name: CI
on:
pull_request:
pull_request_target:
# Run on release-please PRs (created by GITHUB_TOKEN which doesn't trigger regular pull_request)
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-slim
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# For pull_request_target, explicitly checkout the PR head (for security)
# For regular pull_request and workflow_dispatch, checkout action uses defaults
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Prettier check
run: pnpm run format:check
lint:
runs-on: ubuntu-slim
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# For pull_request_target, explicitly checkout the PR head (for security)
# For regular pull_request and workflow_dispatch, checkout action uses defaults
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run ESLint
run: pnpm run lint
build:
runs-on: ubuntu-slim
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# For pull_request_target, explicitly checkout the PR head (for security)
# For regular pull_request and workflow_dispatch, checkout action uses defaults
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build TypeScript
run: pnpm run build
test:
runs-on: ubuntu-slim
needs: build
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
if: (github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# For pull_request_target, explicitly checkout the PR head (for security)
# For regular pull_request and workflow_dispatch, checkout action uses defaults
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run component tests with coverage
run: pnpm run test:components
- name: Upload coverage report
uses: actions/upload-artifact@v6
if: always()
with:
name: component-coverage
path: coverage/
retention-days: 7
ready-to-merge:
runs-on: ubuntu-slim
needs: [format, lint, build, test]
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
if: always() && ((github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch')
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.format.result }}" != "success" ]] || \
[[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.build.result }}" != "success" ]] || \
[[ "${{ needs.test.result }}" != "success" ]]; then
echo "One or more required jobs failed"
exit 1
fi
echo "All required jobs passed!"