ci.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. os: [ubuntu-latest, macos-latest, windows-latest]
  59. node: ["24"]
  60. include:
  61. - os: ubuntu-latest
  62. node: "24"
  63. profile: full
  64. runs-on: ${{ matrix.os }}
  65. steps:
  66. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  67. - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
  68. with:
  69. version: 9.12.0
  70. - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
  71. with:
  72. node-version: ${{ matrix.node }}
  73. cache: pnpm
  74. - run: pnpm install --frozen-lockfile
  75. # Keep the gate list in the shared verifier. Every OS builds and tests its
  76. # own native artifacts; only the duplicate compiler check is omitted.
  77. - run: pnpm verify --profile ${{ matrix.profile || 'platform' }}
  78. env:
  79. MCODE_VERIFY_REPORT_DIR: ${{ runner.temp }}/verification
  80. - name: Upload verification summary
  81. if: ${{ always() }}
  82. timeout-minutes: 2
  83. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
  84. with:
  85. name: verification-${{ matrix.os }}-node-${{ matrix.node }}-${{ github.run_attempt }}
  86. path: |
  87. ${{ runner.temp }}/verification/verification.json
  88. ${{ runner.temp }}/verification/verification.md
  89. ${{ runner.temp }}/verification/export.json
  90. retention-days: 7
  91. if-no-files-found: warn
  92. verification:
  93. name: verification
  94. if: ${{ always() }}
  95. needs: [changes, docs, verify]
  96. runs-on: ubuntu-latest
  97. timeout-minutes: 2
  98. steps:
  99. - name: Require every planned check
  100. env:
  101. CLASSIFICATION: ${{ needs.changes.result }}
  102. DOCS_ONLY: ${{ needs.changes.outputs.docs_only }}
  103. DOCS_RESULT: ${{ needs.docs.result }}
  104. MATRIX_RESULT: ${{ needs.verify.result }}
  105. shell: bash
  106. run: |
  107. test "$CLASSIFICATION" = success
  108. if [ "$DOCS_ONLY" = true ]; then
  109. test "$DOCS_RESULT" = success
  110. test "$MATRIX_RESULT" = skipped
  111. elif [ "$DOCS_ONLY" = false ]; then
  112. test "$MATRIX_RESULT" = success
  113. test "$DOCS_RESULT" = skipped
  114. else
  115. exit 1
  116. fi