From 6052b03fc6ad16ab773517bc977fd46e3259a1b2 Mon Sep 17 00:00:00 2001 From: wangziqi Date: Wed, 22 Jul 2026 11:50:53 +0800 Subject: [PATCH] ci: cache npm and Turbo artifacts --- .gitea/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 265fde3..b706b00 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -27,6 +27,22 @@ jobs: github-server-url: https://git.gongxue100.com fetch-depth: 1 + - name: Restore npm cache + uses: https://gitee.com/mirrors_actions/cache@v4 + with: + path: ~/.npm + key: npm-${{ runner.os }}-node22-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-${{ runner.os }}-node22- + + - name: Restore Turbo cache + uses: https://gitee.com/mirrors_actions/cache@v4 + with: + path: .turbo + key: turbo-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ gitea.sha }} + restore-keys: | + turbo-${{ runner.os }}-${{ hashFiles('package-lock.json') }}- + - name: Install dependencies run: npm ci @@ -39,7 +55,7 @@ jobs: run: npm run typecheck - name: Build frontend - run: npm run build -w @gongxue/admin + run: npm exec turbo -- run build --filter=@gongxue/admin - name: Run backend tests - run: npm run test -w @gongxue/server -- --runInBand --forceExit + run: npm exec turbo -- run test --filter=@gongxue/server -- --runInBand --forceExit