From ad2234c137e0219c73ea5d3eb26521b245547474 Mon Sep 17 00:00:00 2001 From: woksin Date: Thu, 12 Nov 2026 00:22:42 +0100 Subject: [PATCH 1/2] Cache Yarn packages and cancel superseded pull request runs Restores the shared Yarn cache in every CI job (saved only from main) and groups CI concurrency by pull request number. Policy verification no longer cancels runs outside pull requests. (part of #208) --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/verify-pull-request-policy.yml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1873177f..998679d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: @@ -66,6 +66,8 @@ jobs: node-version: '22.19.0' - name: Enable Yarn from the repository package manager run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce - name: Install locked dependencies run: yarn install --immutable - name: Check documentation @@ -87,6 +89,8 @@ jobs: node-version: '22.19.0' - name: Enable Yarn from the repository package manager run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce - name: Install locked dependencies run: yarn install --immutable - name: Build integration dependencies @@ -116,6 +120,8 @@ jobs: node-version: '22.19.0' - name: Enable Yarn from the repository package manager run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce - name: Install locked dependencies run: yarn install --immutable - name: Check tutorial assembler negative cases @@ -141,6 +147,8 @@ jobs: node-version: '22.19.0' - name: Enable Yarn from the repository package manager run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce - name: Install locked dependencies run: yarn install --immutable - name: Run the complete local gate diff --git a/.github/workflows/verify-pull-request-policy.yml b/.github/workflows/verify-pull-request-policy.yml index fd636cc3..775e6773 100644 --- a/.github/workflows/verify-pull-request-policy.yml +++ b/.github/workflows/verify-pull-request-policy.yml @@ -8,7 +8,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read From c6069bbcf95ae973a84ceb957788368e875f3f20 Mon Sep 17 00:00:00 2001 From: woksin Date: Thu, 12 Nov 2026 00:33:38 +0100 Subject: [PATCH 2/2] Run CI checks in parallel jobs --- .github/workflows/ci.yml | 104 +++++++++++++++++++++++++++++++++++++-- package.json | 6 ++- 2 files changed, 106 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 998679d8..a79adeb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,7 +131,80 @@ jobs: ARC_DOCUMENTATION: ${{ github.workspace }}/.arc-tutorial-source/Documentation run: yarn build && bash Documentation/tutorial-e2e/run.sh - verify: + verify-artifacts: + needs: changes + if: needs.changes.outputs.code == 'true' + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Check out code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: '22.19.0' + - name: Enable Yarn from the repository package manager + run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce + - name: Install locked dependencies + run: yarn install --immutable + - name: Build packages and check generated artifacts and consumers + run: yarn ci:artifacts + + verify-quality: + needs: changes + if: needs.changes.outputs.code == 'true' + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Check out code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: '22.19.0' + - name: Enable Yarn from the repository package manager + run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce + - name: Install locked dependencies + run: yarn install --immutable + - name: Build prerequisites + run: yarn build + - name: Lint and typecheck + run: yarn ci:quality + + verify-tests: + needs: changes + if: needs.changes.outputs.code == 'true' + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Check out code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: '22.19.0' + - name: Enable Yarn from the repository package manager + run: corepack enable + - name: Cache Yarn packages + uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce + - name: Install locked dependencies + run: yarn install --immutable + - name: Build prerequisites + run: yarn build + - name: Run unit, client contract, decorator and Library end-to-end tests + run: yarn ci:tests + + verify-docs: needs: changes if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest @@ -151,5 +224,30 @@ jobs: uses: Cratis/Workflows/.github/actions/yarn-cache@2fa2cb4fedb8048c4afb7f1a14e0103a35b0f1ce - name: Install locked dependencies run: yarn install --immutable - - name: Run the complete local gate - run: yarn ci + - name: Build prerequisites + run: yarn build + - name: Check documentation, release scripts and version consistency + run: yarn ci:docs + + # Preserve the existing check name, including intentionally skipped code checks. + verify: + needs: [changes, verify-artifacts, verify-quality, verify-tests, verify-docs] + if: always() + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: {} + steps: + - name: Require every code check to succeed when code changes + env: + CHANGES_RESULT: ${{ needs.changes.result }} + CODE: ${{ needs.changes.outputs.code }} + RESULTS: ${{ toJSON(needs.*.result) }} + run: | + if [[ "$CHANGES_RESULT" != success ]]; then + exit 1 + fi + if [[ "$CODE" == true ]]; then + jq -e 'all(. == "success")' <<< "$RESULTS" + else + jq -e 'all(. == "success" or . == "skipped")' <<< "$RESULTS" + fi diff --git a/package.json b/package.json index 106c08b4..254e8a45 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,11 @@ "set-version": "node scripts/set-version.mjs", "test": "vitest run", "specs": "yarn test", - "ci": "yarn tsc -b Source/Core Source/Testing Source/Chronicle Source/MongoDB Source/Tools/ProxyGenerator && yarn check:metadata && yarn workspace @cratis/arc.core.sample.tasks generate-proxies && yarn workspace @cratis/arc.sample.library generate-proxies && yarn workspace @cratis/arc.sample.showcase generate-proxies && yarn check:proxies && yarn build && yarn check:declarations && yarn check:declarations:self-test && yarn check:consumers && yarn check:chronicle-peer-floor:self-test && yarn check:chronicle-peer-floor && yarn check:fetch && yarn check:node-test && yarn check:observability-recipes && yarn workspace @cratis/arc.sample.library.web build && yarn lint && yarn typecheck && yarn lint:tasks:arc && yarn test:client-generation:verify && yarn test && yarn workspace @cratis/arc.sample.library test:e2e && yarn test:legacy-decorators && yarn test:decorator-types && yarn docs:lint && yarn docs:snippets:self-test && yarn docs:snippets && yarn docs:examples:self-test && yarn docs:examples && node --test scripts/for_release/*.test.mjs && node --test scripts/classify-changes.test.mjs && yarn set-version --check" + "ci:artifacts": "yarn tsc -b Source/Core Source/Testing Source/Chronicle Source/MongoDB Source/Tools/ProxyGenerator && yarn check:metadata && yarn workspace @cratis/arc.core.sample.tasks generate-proxies && yarn workspace @cratis/arc.sample.library generate-proxies && yarn workspace @cratis/arc.sample.showcase generate-proxies && yarn check:proxies && yarn build && yarn check:declarations && yarn check:declarations:self-test && yarn check:consumers && yarn check:chronicle-peer-floor:self-test && yarn check:chronicle-peer-floor && yarn check:fetch && yarn check:node-test && yarn check:observability-recipes && yarn workspace @cratis/arc.sample.library.web build", + "ci:quality": "yarn lint && yarn typecheck && yarn lint:tasks:arc", + "ci:tests": "yarn test:client-generation:verify && yarn test && yarn workspace @cratis/arc.sample.library test:e2e && yarn test:legacy-decorators && yarn test:decorator-types", + "ci:docs": "yarn docs:lint && yarn docs:snippets:self-test && yarn docs:snippets && yarn docs:examples:self-test && yarn docs:examples && node --test scripts/for_release/*.test.mjs && node --test scripts/classify-changes.test.mjs && yarn set-version --check", + "ci": "yarn ci:artifacts && yarn ci:quality && yarn ci:tests && yarn ci:docs" }, "devDependencies": { "@cratis/arc.react": "22.45.0",