From b989815829ec8f0c36a37ff676ccdc6b3095213a Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Fri, 30 Oct 2026 00:16:28 +0000 Subject: [PATCH] Speed up CI setup and coverage upload pnpm/action-setup installs a bootstrap pnpm and then switches to the packageManager version, about 10 s per job; npm installs it in 3 s. setup-node took 4 s probing package managers for a cache it never used. The pnpm store cache took 4 s to restore and 5 s to save, more than downloading the packages costs, and the build cache no longer pays off with TypeScript 7: pnpm install is 13-23 s without either cache against 17-31 s with them. The Codecov action searched the workspace and uploaded the raw V8 coverage in coverage/tmp next to lcov.info, 72 MB taking 11 s. The version compatibility job ran tsc --build again after pnpm install had already built everything. Cancel superseded runs of branches and pull requests. Co-Authored-By: Claude Opus 5.5 --- .github/actions/pnpm-install/action.yml | 37 ++++--------------------- .github/workflows/lua-lint.yml | 4 +++ .github/workflows/node.js.yml | 10 +++++-- 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.yml index 7a5037e5..42112fc2 100644 --- a/.github/actions/pnpm-install/action.yml +++ b/.github/actions/pnpm-install/action.yml @@ -1,5 +1,5 @@ name: Install dependencies -description: Set up pnpm and Node.js, restore caches and run pnpm install +description: Set up pnpm and Node.js and run pnpm install inputs: node-version: @@ -12,40 +12,15 @@ inputs: runs: using: composite steps: - - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v7 with: node-version: ${{ inputs.node-version }} + package-manager-cache: false - # The lockfile is not committed, so the usual lockfile hash key does not - # apply. Instead a new store snapshot is saved whenever a package.json - # changes or a week passes, and every run restores the most recent one. - - id: store - shell: bash - run: | - echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" - echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT" - - uses: actions/cache@v6 - with: - path: ${{ steps.store.outputs.path }} - key: pnpm-store-${{ runner.os }}-${{ steps.store.outputs.week }}-${{ hashFiles('**/package.json', 'pnpm-workspace.yaml') }} - restore-keys: pnpm-store-${{ runner.os }}- - - # The prepare scripts run tsc --build, which is incremental when its - # previous output is present. Every run saves its output and the next run - # starts from the most recent one. - - if: inputs.ignore-scripts != 'true' - uses: actions/cache@v6 - with: - path: | - packages/*/dist - plugins/*/dist - key: build-${{ runner.os }}-${{ github.sha }} - restore-keys: build-${{ runner.os }}- + # pnpm/action-setup installs a bootstrap pnpm and then switches to the + # packageManager version, which takes about 10 seconds. + - shell: bash + run: npm install --global --no-audit --no-fund "$(node -p 'require("./package.json").packageManager.split("+")[0]')" - shell: bash run: pnpm i --no-frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }} - # Drop packages the restored store had but this install did not use, so - # the snapshot does not grow with every version bump. - - shell: bash - run: pnpm store prune diff --git a/.github/workflows/lua-lint.yml b/.github/workflows/lua-lint.yml index 7e29a49f..0d1c9cde 100644 --- a/.github/workflows/lua-lint.yml +++ b/.github/workflows/lua-lint.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} + cancel-in-progress: true + env: EMMYLUA_CHECK_VERSION: "0.25.1" diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d7a76b97..9a0508f6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -7,6 +7,12 @@ on: push: pull_request: +# Superseded runs of a branch or pull request are cancelled. Runs on master +# each get their own group so every commit there is tested. +concurrency: + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} + cancel-in-progress: true + env: NODE_VERSION: 24.x @@ -54,6 +60,8 @@ jobs: uses: codecov/codecov-action@v7 with: files: ./coverage/lcov.info + # Otherwise the raw V8 coverage in coverage/tmp is uploaded as well + disable_search: true token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test logs for debugging if: ${{ !cancelled() }} @@ -87,8 +95,6 @@ jobs: uses: ./.github/actions/pnpm-install with: node-version: ${{ env.NODE_VERSION }} - - name: Build - run: pnpm run build - name: Test ${{ matrix.controller }} controller with ${{ matrix.host }} host run: > node scripts/version-compat-test.js