landlock-run.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. defaults:
  19. run:
  20. working-directory: native/landlock-run
  21. jobs:
  22. matrix:
  23. name: Matrix
  24. runs-on: ubuntu-24.04
  25. outputs:
  26. ci: ${{ steps.matrix.outputs.ci }}
  27. steps:
  28. - uses: actions/checkout@v4
  29. - id: matrix
  30. run: echo "ci=$(node ./scripts/github-matrix.mjs ci)" >> "$GITHUB_OUTPUT"
  31. native:
  32. name: ${{ matrix.platform }}
  33. needs: matrix
  34. runs-on: ${{ matrix.runner }}
  35. strategy:
  36. fail-fast: false
  37. matrix: ${{ fromJson(needs.matrix.outputs.ci) }}
  38. steps:
  39. - uses: actions/checkout@v4
  40. - uses: pnpm/action-setup@v4
  41. with:
  42. package_json_file: native/landlock-run/package.json
  43. - uses: actions/setup-node@v4
  44. with:
  45. node-version: 24
  46. cache: pnpm
  47. cache-dependency-path: native/landlock-run/pnpm-lock.yaml
  48. - name: Install dependencies
  49. run: pnpm install --frozen-lockfile
  50. - name: Install musl toolchain
  51. run: |
  52. sudo apt-get update -q
  53. sudo apt-get install -yq musl-tools
  54. - name: Build TypeScript
  55. run: pnpm build:ts
  56. - name: Typecheck
  57. run: pnpm typecheck
  58. - name: Build native binaries (this architecture is the builder of record)
  59. run: pnpm build:native
  60. - name: Entry tests (keyless)
  61. run: node ./test/entry.test.js
  62. # NALR_REQUIRE_LANDLOCK: a self-skip on the very platform that exists to
  63. # prove enforcement would be a false green, so an unenforcing kernel
  64. # fails the leg instead of skipping.
  65. - name: Launcher tests (real kernel enforcement)
  66. run: node ./test/launcher.test.js
  67. env:
  68. NALR_REQUIRE_LANDLOCK: 1
  69. - name: Pack rehearsal (pack → install → confine, this platform only)
  70. run: |
  71. node ./scripts/pack-release.mjs .release/npm --current-platform-only
  72. node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only
  73. env:
  74. NALR_REQUIRE_LANDLOCK: 1
  75. darwin:
  76. name: darwin (no platform package — degradation proof)
  77. runs-on: macos-latest
  78. steps:
  79. - uses: actions/checkout@v4
  80. - uses: pnpm/action-setup@v4
  81. with:
  82. package_json_file: native/landlock-run/package.json
  83. - uses: actions/setup-node@v4
  84. with:
  85. node-version: 24
  86. cache: pnpm
  87. cache-dependency-path: native/landlock-run/pnpm-lock.yaml
  88. - name: Install dependencies
  89. run: pnpm install --frozen-lockfile
  90. - name: Build TypeScript
  91. run: pnpm build:ts
  92. - name: Typecheck
  93. run: pnpm typecheck
  94. - name: Entry tests (keyless)
  95. run: node ./test/entry.test.js
  96. - name: Launcher tests (must self-skip cleanly)
  97. run: node ./test/launcher.test.js
  98. - name: Pack rehearsal (entry only — fallback resolution + unusable probe)
  99. run: |
  100. node ./scripts/pack-release.mjs .release/npm --current-platform-only
  101. node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only