1
0

node-addon-system.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. # CI for the node-addon-system packages under native/system. A separate
  2. # workflow from ci.yml keeps the native OS/architecture matrix independent of
  3. # the harness Node matrix. Each platform job builds once and tests those bytes
  4. # under every supported Node release. Release assembly and publication use the
  5. # companion Node Addon System Release workflow.
  6. name: Node Addon System
  7. on:
  8. pull_request:
  9. paths:
  10. - '.github/workflows/node-addon-system.yml'
  11. - '.github/workflows/node-addon-system-release.yml'
  12. - 'native/system/**'
  13. - 'package.json'
  14. - 'pnpm-lock.yaml'
  15. - 'pnpm-workspace.yaml'
  16. push:
  17. branches: [master]
  18. paths:
  19. - '.github/workflows/node-addon-system.yml'
  20. - '.github/workflows/node-addon-system-release.yml'
  21. - 'native/system/**'
  22. - 'package.json'
  23. - 'pnpm-lock.yaml'
  24. - 'pnpm-workspace.yaml'
  25. workflow_dispatch:
  26. concurrency:
  27. group: ${{ github.workflow }}-${{ github.ref }}
  28. cancel-in-progress: true
  29. permissions:
  30. contents: read
  31. env:
  32. # CI runs must never report to the production telemetry endpoint baked
  33. # into apps/cli/cordis.yml (AppCLIEntry disables the row when set).
  34. DSH_TELEMETRY_DISABLED: '1'
  35. defaults:
  36. run:
  37. working-directory: native/system
  38. jobs:
  39. matrix:
  40. name: Matrix
  41. runs-on: ubuntu-24.04
  42. outputs:
  43. ci: ${{ steps.matrix.outputs.ci }}
  44. steps:
  45. - uses: actions/checkout@v4
  46. - id: matrix
  47. run: echo "ci=$(node ./scripts/github-matrix.mjs ci)" >> "$GITHUB_OUTPUT"
  48. native:
  49. name: ${{ matrix.platform }}
  50. needs: matrix
  51. runs-on: ${{ matrix.runner }}
  52. strategy:
  53. fail-fast: false
  54. matrix: ${{ fromJson(needs.matrix.outputs.ci) }}
  55. steps:
  56. - uses: actions/checkout@v4
  57. - uses: pnpm/action-setup@v4
  58. with:
  59. package_json_file: package.json
  60. - uses: actions/setup-node@v4
  61. with:
  62. node-version: 24
  63. cache: pnpm
  64. cache-dependency-path: pnpm-lock.yaml
  65. - name: Install dependencies
  66. run: pnpm install --filter @deepseek-ai/node-addon-system-workspace... --frozen-lockfile
  67. - name: Install musl toolchain
  68. if: runner.os == 'Linux'
  69. run: |
  70. sudo apt-get update -q
  71. sudo apt-get install -yq musl-tools
  72. - name: Build TypeScript
  73. run: pnpm build:ts
  74. - name: Typecheck
  75. run: pnpm typecheck
  76. - name: Build native binaries (this architecture is the builder of record)
  77. run: pnpm build:native
  78. - name: Entry tests (keyless)
  79. run: node ./test/entry.test.js
  80. # NALR_REQUIRE_LANDLOCK: a self-skip on the very platform that exists to
  81. # prove enforcement would be a false green, so an unenforcing kernel
  82. # fails the leg instead of skipping.
  83. - name: Launcher tests (real kernel enforcement)
  84. if: runner.os == 'Linux'
  85. run: node ./test/launcher.test.js
  86. env:
  87. NALR_REQUIRE_LANDLOCK: 1
  88. - name: Pack rehearsal (pack → install → confine, this platform only)
  89. run: |
  90. node ./scripts/pack-release.mjs .release/npm --current-platform-only
  91. node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only
  92. env:
  93. NALR_REQUIRE_LANDLOCK: ${{ runner.os == 'Linux' && '1' || '0' }}
  94. - name: Verify platform payload rules (Node 24)
  95. run: pnpm test:packaging
  96. - name: Flock behavior (Node 24, built addon)
  97. run: |
  98. pnpm build:test-oracle
  99. pnpm test:flock
  100. - name: Test the same musl addon on Node 24 without a compiler
  101. if: runner.os == 'Linux'
  102. run: >-
  103. docker run --rm -v "$PWD:$PWD" -w "$PWD"
  104. node:24-alpine
  105. node --test ./test/flock.test.js ./test/package-matrix.test.js
  106. - uses: actions/setup-node@v4
  107. with:
  108. node-version: 20
  109. - name: Test the same binaries on Node 20
  110. run: node --test ./test/flock.test.js ./test/package-matrix.test.js
  111. - name: Test the same musl addon on Node 20 without a compiler
  112. if: runner.os == 'Linux'
  113. run: >-
  114. docker run --rm -v "$PWD:$PWD" -w "$PWD"
  115. node:20-alpine
  116. node --test ./test/flock.test.js ./test/package-matrix.test.js
  117. - uses: actions/setup-node@v4
  118. with:
  119. node-version: 22
  120. - name: Test the same binaries on Node 22
  121. run: node --test ./test/flock.test.js ./test/package-matrix.test.js
  122. - name: Test the same musl addon on Node 22 without a compiler
  123. if: runner.os == 'Linux'
  124. run: >-
  125. docker run --rm -v "$PWD:$PWD" -w "$PWD"
  126. node:22-alpine
  127. node --test ./test/flock.test.js ./test/package-matrix.test.js
  128. - uses: actions/setup-node@v4
  129. with:
  130. node-version: 26
  131. - name: Test the same binaries on Node 26
  132. run: node --test ./test/flock.test.js ./test/package-matrix.test.js
  133. - name: Test the same musl addon on Node 26 without a compiler
  134. if: runner.os == 'Linux'
  135. run: >-
  136. docker run --rm -v "$PWD:$PWD" -w "$PWD"
  137. node:26-alpine
  138. node --test ./test/flock.test.js ./test/package-matrix.test.js