name: CI on: push: branches: [main] pull_request: jobs: test: name: node ${{ matrix.node }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] node: ['22', '24'] steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 # version comes from packageManager in package.json - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} cache: pnpm - run: pnpm install --frozen-lockfile # The published artifact is a bundle, so a broken build must fail CI. - run: pnpm run build # `pipefail`, or the step passes because `tee` succeeded. - name: Test shell: bash run: | set -o pipefail pnpm test 2>&1 | tee test-log.txt # Reading a job's log needs a token; annotations are public. Republishing # the failures means anyone can see what broke, from the commit or the API, # without being able to open the run. - name: Say what failed if: failure() shell: bash run: | awk '/^not ok /,/^ \.\.\.$/' test-log.txt | head -60 | while IFS= read -r line; do printf '::error::%s\n' "$line" done