ソースを参照

chore: cache node_modules

Dogtiti 1 年間 前
コミット
bd43af3a8d
1 ファイル変更15 行追加1 行削除
  1. 15 1
      .github/workflows/test.yml

+ 15 - 1
.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