Skip to content

feat(scripts): improve version.js to read from pnpm-workspace.yaml and filter by private field #419

feat(scripts): improve version.js to read from pnpm-workspace.yaml and filter by private field

feat(scripts): improve version.js to read from pnpm-workspace.yaml and filter by private field #419

Workflow file for this run

name: CI
on:
push:
branches: [next]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [next]
merge_group:
permissions:
id-token: write
actions: write
jobs:
cancel-on-pr-close:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed'
steps:
- name: Cancel running workflows on PR close/merge
uses: actions/github-script@v8
with:
script: |
const { owner, repo } = context.repo;
const pr_number = context.payload.pull_request.number;
const head_sha = context.payload.pull_request.head.sha;
console.log(`PR #${pr_number} was ${context.payload.pull_request.merged ? 'merged' : 'closed'}`);
console.log(`Cancelling workflows for SHA: ${head_sha}`);
// Get all workflow runs for this PR's head SHA
const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({
owner,
repo,
head_sha,
status: 'in_progress'
});
console.log(`Found ${runs.workflow_runs.length} in-progress workflow runs`);
// Cancel each running workflow
for (const run of runs.workflow_runs) {
if (run.status === 'in_progress') {
console.log(`Cancelling workflow run ${run.id} (${run.name})`);
await github.rest.actions.cancelWorkflowRun({
owner,
repo,
run_id: run.id
});
}
}
console.log('All running workflows have been cancelled');
typecheck:
runs-on: ubuntu-latest
concurrency:
group: typecheck-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run lint
run: pnpm run lint
- name: Run typecheck
run: pnpm run typecheck
test-packages:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node: ['22', '24']
name: Test packages (${{ matrix.os }}, ${{ matrix.node }})
runs-on: ${{ matrix.os }}
concurrency:
group: test-packages-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }}, ${{ matrix.node }})
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm run ci
- name: Code Coverage
# skip on windows, it will hangup on codecov
if: ${{ matrix.os != 'windows-latest' }}
uses: codecov/codecov-action@v5
with:
use_oidc: true
test-egg-bin:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node: ['22', '24']
name: Test egg-bin (${{ matrix.os }}, ${{ matrix.node }})
runs-on: ${{ matrix.os }}
concurrency:
group: test-egg-bin-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }}, ${{ matrix.node }})
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm run --filter="@eggjs/bin" ci
- name: Code Coverage
# skip on windows, it will hangup on codecov https://github.com/codecov/codecov-action/issues/1787
if: ${{ matrix.os != 'windows-latest' }}
uses: codecov/codecov-action@v5
with:
use_oidc: true