landlock-run.yml 4.1 KB

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