ci.yml 1.6 KB

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