landlock-run.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Manually-dispatched CI for the landlock-run source of record
  2. # (native/landlock-run). A separate workflow from ci.yml on purpose: the
  3. # subtree is a self-contained pnpm workspace with its own gates, exercised on
  4. # demand — per-architecture native legs (build + behavioral tests + pack
  5. # rehearsal on real kernels) plus one darwin leg proving the documented
  6. # degradation on hosts without a platform package. Legs derive from the
  7. # subtree's checked-in package matrix (scripts/github-matrix.mjs). Packing
  8. # for npm happens in the release mirror (node-addon-landlock-run) after an
  9. # export — see native/README.md; this workflow never packs for release.
  10. name: Landlock Run
  11. on:
  12. workflow_dispatch:
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.ref }}
  15. cancel-in-progress: true
  16. permissions:
  17. contents: read
  18. env:
  19. # CI runs must never report to the production telemetry endpoint baked
  20. # into apps/cli/cordis.yml (AppCLIEntry disables the row when set).
  21. DSH_TELEMETRY_DISABLED: '1'
  22. defaults:
  23. run:
  24. working-directory: native/landlock-run
  25. jobs:
  26. matrix:
  27. name: Matrix
  28. runs-on: ubuntu-24.04
  29. outputs:
  30. ci: ${{ steps.matrix.outputs.ci }}
  31. steps:
  32. - uses: actions/checkout@v4
  33. - id: matrix
  34. run: echo "ci=$(node ./scripts/github-matrix.mjs ci)" >> "$GITHUB_OUTPUT"
  35. native:
  36. name: ${{ matrix.platform }}
  37. needs: matrix
  38. runs-on: ${{ matrix.runner }}
  39. strategy:
  40. fail-fast: false
  41. matrix: ${{ fromJson(needs.matrix.outputs.ci) }}
  42. steps:
  43. - uses: actions/checkout@v4
  44. - uses: pnpm/action-setup@v4
  45. with:
  46. package_json_file: native/landlock-run/package.json
  47. - uses: actions/setup-node@v4
  48. with:
  49. node-version: 24
  50. cache: pnpm
  51. cache-dependency-path: native/landlock-run/pnpm-lock.yaml
  52. - name: Install dependencies
  53. run: pnpm install --frozen-lockfile
  54. - name: Install musl toolchain
  55. run: |
  56. sudo apt-get update -q
  57. sudo apt-get install -yq musl-tools
  58. - name: Build TypeScript
  59. run: pnpm build:ts
  60. - name: Typecheck
  61. run: pnpm typecheck
  62. - name: Build native binaries (this architecture is the builder of record)
  63. run: pnpm build:native
  64. - name: Entry tests (keyless)
  65. run: node ./test/entry.test.js
  66. # NALR_REQUIRE_LANDLOCK: a self-skip on the very platform that exists to
  67. # prove enforcement would be a false green, so an unenforcing kernel
  68. # fails the leg instead of skipping.
  69. - name: Launcher tests (real kernel enforcement)
  70. run: node ./test/launcher.test.js
  71. env:
  72. NALR_REQUIRE_LANDLOCK: 1
  73. - name: Pack rehearsal (pack → install → confine, this platform only)
  74. run: |
  75. node ./scripts/pack-release.mjs .release/npm --current-platform-only
  76. node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only
  77. env:
  78. NALR_REQUIRE_LANDLOCK: 1
  79. darwin:
  80. name: darwin (no platform package — degradation proof)
  81. runs-on: macos-latest
  82. steps:
  83. - uses: actions/checkout@v4
  84. - uses: pnpm/action-setup@v4
  85. with:
  86. package_json_file: native/landlock-run/package.json
  87. - uses: actions/setup-node@v4
  88. with:
  89. node-version: 24
  90. cache: pnpm
  91. cache-dependency-path: native/landlock-run/pnpm-lock.yaml
  92. - name: Install dependencies
  93. run: pnpm install --frozen-lockfile
  94. - name: Build TypeScript
  95. run: pnpm build:ts
  96. - name: Typecheck
  97. run: pnpm typecheck
  98. - name: Entry tests (keyless)
  99. run: node ./test/entry.test.js
  100. - name: Launcher tests (must self-skip cleanly)
  101. run: node ./test/launcher.test.js
  102. - name: Pack rehearsal (entry only — fallback resolution + unusable probe)
  103. run: |
  104. node ./scripts/pack-release.mjs .release/npm --current-platform-only
  105. node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only