ci.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. name: Source verification
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. workflow_dispatch:
  7. concurrency:
  8. group: ${{ github.workflow }}-${{ github.ref }}
  9. cancel-in-progress: true
  10. permissions:
  11. contents: read
  12. jobs:
  13. changes:
  14. runs-on: ubuntu-latest
  15. timeout-minutes: 5
  16. outputs:
  17. docs_only: ${{ steps.scope.outputs.docs_only }}
  18. steps:
  19. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  20. with:
  21. fetch-depth: 0
  22. - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
  23. with:
  24. node-version: "24"
  25. package-manager-cache: false
  26. - id: scope
  27. run: node scripts/ci-changes.mjs
  28. docs:
  29. needs: changes
  30. if: needs.changes.outputs.docs_only == 'true'
  31. runs-on: ubuntu-latest
  32. timeout-minutes: 10
  33. steps:
  34. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  35. - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
  36. - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
  37. with:
  38. node-version: "24"
  39. cache: pnpm
  40. - run: pnpm install --frozen-lockfile
  41. - run: pnpm verify --profile docs
  42. env:
  43. MCODE_VERIFY_REPORT_DIR: ${{ runner.temp }}/verification
  44. - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
  45. if: ${{ always() }}
  46. with:
  47. name: documentation-verification-${{ github.run_attempt }}
  48. path: ${{ runner.temp }}/verification/
  49. retention-days: 7
  50. verify:
  51. needs: changes
  52. if: needs.changes.outputs.docs_only == 'false'
  53. name: verify (${{ matrix.os }}, ${{ matrix.node }})
  54. timeout-minutes: 15
  55. strategy:
  56. fail-fast: false
  57. matrix:
  58. # Windows validation is temporarily paused until its checks are reliable.
  59. os: [ubuntu-latest, macos-latest]
  60. node: ["24"]
  61. include:
  62. - os: ubuntu-latest
  63. node: "24"
  64. profile: full
  65. runs-on: ${{ matrix.os }}
  66. steps:
  67. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  68. - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
  69. with:
  70. version: 9.12.0
  71. - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
  72. with:
  73. node-version: ${{ matrix.node }}
  74. cache: pnpm
  75. - run: pnpm install --frozen-lockfile
  76. # Keep the gate list in the shared verifier. Every OS builds and tests its
  77. # own native artifacts; only the duplicate compiler check is omitted.
  78. - run: pnpm verify --profile ${{ matrix.profile || 'platform' }}
  79. env:
  80. MCODE_VERIFY_REPORT_DIR: ${{ runner.temp }}/verification
  81. - name: Upload verification summary
  82. if: ${{ always() }}
  83. timeout-minutes: 2
  84. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
  85. with:
  86. name: verification-${{ matrix.os }}-node-${{ matrix.node }}-${{ github.run_attempt }}
  87. path: |
  88. ${{ runner.temp }}/verification/verification.json
  89. ${{ runner.temp }}/verification/verification.md
  90. ${{ runner.temp }}/verification/export.json
  91. retention-days: 7
  92. if-no-files-found: warn
  93. verification:
  94. name: verification
  95. if: ${{ always() }}
  96. needs: [changes, docs, verify]
  97. runs-on: ubuntu-latest
  98. timeout-minutes: 2
  99. steps:
  100. - name: Require every planned check
  101. env:
  102. CLASSIFICATION: ${{ needs.changes.result }}
  103. DOCS_ONLY: ${{ needs.changes.outputs.docs_only }}
  104. DOCS_RESULT: ${{ needs.docs.result }}
  105. MATRIX_RESULT: ${{ needs.verify.result }}
  106. shell: bash
  107. run: |
  108. test "$CLASSIFICATION" = success
  109. if [ "$DOCS_ONLY" = true ]; then
  110. test "$DOCS_RESULT" = success
  111. test "$MATRIX_RESULT" = skipped
  112. elif [ "$DOCS_ONLY" = false ]; then
  113. test "$MATRIX_RESULT" = success
  114. test "$DOCS_RESULT" = skipped
  115. else
  116. exit 1
  117. fi