ci.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: CI
  2. on:
  3. push:
  4. branches: [master, main]
  5. pull_request:
  6. branches: [master, main]
  7. jobs:
  8. build-and-test:
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. fail-fast: false
  12. matrix:
  13. os: [ubuntu-latest, windows-latest]
  14. node-version: [20, 22]
  15. steps:
  16. - uses: actions/checkout@v4
  17. - uses: pnpm/action-setup@v4
  18. with:
  19. version: 9
  20. - uses: actions/setup-node@v4
  21. with:
  22. node-version: ${{ matrix.node-version }}
  23. cache: pnpm
  24. - run: pnpm install --frozen-lockfile
  25. - run: pnpm build
  26. - run: pnpm test
  27. verify-pack:
  28. runs-on: ubuntu-latest
  29. needs: build-and-test
  30. steps:
  31. - uses: actions/checkout@v4
  32. - uses: pnpm/action-setup@v4
  33. with:
  34. version: 9
  35. - uses: actions/setup-node@v4
  36. with:
  37. node-version: 22
  38. cache: pnpm
  39. - run: pnpm install --frozen-lockfile
  40. - run: pnpm build
  41. - name: Verify no workspace:* in tarballs
  42. run: |
  43. set -euo pipefail
  44. for pkg in packages/core packages/cli; do
  45. echo "--- Checking $pkg ---"
  46. cd "$pkg"
  47. PACKDIR=$(mktemp -d)
  48. npm pack --pack-destination "$PACKDIR" 2>/dev/null
  49. TGZ=$(ls "$PACKDIR"/*.tgz)
  50. PACKED_PKG=$(tar -xOf "$TGZ" package/package.json)
  51. if echo "$PACKED_PKG" | grep -q '"workspace:'; then
  52. echo "FAIL: $pkg tarball still contains workspace: protocol"
  53. echo "$PACKED_PKG" | grep 'workspace:'
  54. rm -rf "$PACKDIR"
  55. exit 1
  56. fi
  57. echo "OK: $pkg tarball is clean"
  58. rm -rf "$PACKDIR"
  59. cd - >/dev/null
  60. done