Skip to content

chore(ci): consolidate ci jobs (#461) #1219

chore(ci): consolidate ci jobs (#461)

chore(ci): consolidate ci jobs (#461) #1219

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node: [ 20, 22, 24 ]
include:
- os: windows-latest
node: 22
node-release-override: 22.11.0
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
name: Install pnpm
with:
run_install: false
version: 10
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
# Node 22.12.0 on Windows incorrectly resolves `localhost` to `::1`, rather than both `::1` and `127.0.0.1`.
# THis causes errors when executing tests. So until this gets fixed upstream, we force the last known good
# version of Node on Windows.
# See https://github.com/nodejs/node/issues/56137 (_resolved_ already, but not yet released).
node-version: ${{ matrix.node-release-override || matrix.node }}
# Comment out cache line when testing with act:
# (Test command is: act --platform ubuntu-latest=lucasalt/act_base:latest)
cache: 'pnpm'
- run: pnpm install
- name: Build and test sample projects
shell: bash
run: |
set +e
failed=()
projects=(
activities-examples
ai-sdk
eager-workflow-start
early-return
empty
hello-world
mutex
nestjs-exchange-rates
sleep-for-days
timer-examples
message-passing/introduction
message-passing/safe-message-handlers
polling/infrequent
)
for project in "${projects[@]}"; do
echo "::group::$project — build"
(cd "$project" && npm run build) || failed+=("$project (build)")
echo "::endgroup::"
echo "::group::$project — test"
(cd "$project" && npm test) || failed+=("$project (test)")
echo "::endgroup::"
done
if [ ${#failed[@]} -ne 0 ]; then
echo "Failed:"
printf ' - %s\n' "${failed[@]}"
exit 1
fi
lint-format-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
name: Install pnpm
with:
run_install: false
version: 10
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 22
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint
- run: pnpm format:check
- run: pnpm build