From e7941bc6f7d147de490db8d5ebc812538445080b Mon Sep 17 00:00:00 2001 From: Will Chen Date: Tue, 10 Jun 2025 12:46:13 -0700 Subject: [PATCH] cache nextjs template (#381) --- .github/workflows/ci.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bf3af1..c3bb1ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,26 @@ jobs: node-version-file: package.json cache: npm cache-dependency-path: package-lock.json + - name: Install node modules + run: npm install + - name: Presubmit check (e.g. lint, format) + # do not run this on Windows (it fails and not necessary) + if: contains(matrix.os.name, 'macos') + run: npm run presubmit + - name: Type-checking + # do not run this on windows (it's redunant) + if: contains(matrix.os.name, 'macos') + run: npm run ts + - name: Unit tests + # do not run this on windows (it's redunant) + if: contains(matrix.os.name, 'macos') + run: npm run test - name: Setup pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 with: version: latest + - name: Clone nextjs-template + run: git clone --depth 1 https://github.com/dyad-sh/nextjs-template.git nextjs-template - name: Get pnpm store directory id: pnpm-cache shell: bash @@ -58,20 +74,8 @@ jobs: # Not strictly needed but makes the e2e tests faster (and less flaky) - name: Install scaffold dependencies run: cd scaffold && pnpm install - - name: Install node modules - run: npm install - - name: Presubmit check (e.g. lint, format) - # do not run this on Windows (it fails and not necessary) - if: contains(matrix.os.name, 'macos') - run: npm run presubmit - - name: Type-checking - # do not run this on windows (it's redunant) - if: contains(matrix.os.name, 'macos') - run: npm run ts - - name: Unit tests - # do not run this on windows (it's redunant) - if: contains(matrix.os.name, 'macos') - run: npm run test + - name: Install nextjs-template dependencies + run: cd nextjs-template && pnpm install - name: Install Chromium browser for Playwright run: npx playwright install chromium --with-deps - name: Build