From 35e61c8cd6048c3a1897011dbb96d5e73b0b3878 Mon Sep 17 00:00:00 2001 From: EmeditWeb Date: Thu, 10 Sep 2026 14:26:34 +0100 Subject: [PATCH] ci: gate all branches, bound job runtime, drop stale-restore cache Harden the API pipeline without changing what passes/fails: - Trigger on push and pull_request for all branches ("**") instead of only `main`, so feature branches are verified before they reach a PR. - Add `timeout-minutes: 15` to the build-test job. Previously an unset timeout let a hung build or test run to GitHub's 6-hour default, silently burning Actions minutes. - Remove the explicit `node_modules` cache step. `npm ci` wipes node_modules before installing, so caching the folder is largely wasted, and its `restore-keys: node-modules-` fallback could restore a node_modules built from a different lockfile. `setup-node`'s `cache: 'npm'` already caches the npm download cache correctly for reproducible `npm ci` installs. Build (`nest build`) and test (`jest`, 40 spec files) steps are unchanged. --- .github/workflows/ci.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f3bd79..eb0f911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,11 @@ name: CI on: push: - branches: [main] + branches: [ "**" ] pull_request: - branches: [main] + branches: [ "**" ] +# cancel superseded runs on the same ref to save minutes concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -16,6 +17,7 @@ permissions: jobs: build-test: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - name: Checkout @@ -27,15 +29,6 @@ jobs: node-version: 20 cache: 'npm' - - name: Cache node_modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: node_modules - key: node-modules-${{ hashFiles('package-lock.json') }} - restore-keys: | - node-modules- - - name: Install dependencies run: npm ci