From bd43af3a8d57d06fd74ca6556641a7397e383684 Mon Sep 17 00:00:00 2001 From: Dogtiti <499960698@qq.com> Date: Fri, 11 Oct 2024 15:41:46 +0800 Subject: [PATCH] chore: cache node_modules --- .github/workflows/test.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2f37cfb436..fc885b29354 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,12 @@ name: Run Tests -on: [push, pull_request] +on: + push: + branches: + - main + tags: + - "!*" + pull_request: jobs: test: @@ -16,6 +22,14 @@ jobs: node-version: 18 cache: "yarn" + - name: Cache node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node_modules- + - name: Install dependencies run: yarn install