@@ -11,14 +11,33 @@ jobs:
1111  cache :
1212    name : CI cache 
1313    runs-on : ubuntu-latest 
14+     outputs :
15+       pnpm-cache : ${{ steps.vars.outputs.pnpm-cache }} 
16+       key : ${{ steps.vars.outputs.key }} 
1417    steps :
1518      - uses : actions/checkout@v3 
16191720      - uses : actions/setup-node@v3 
1821        with :
1922          node-version : " 18.x" 
20-           cache : ' pnpm' 
21-       - run : pnpm install 
23+       - id : vars 
24+         run : | 
25+           echo "pnpm-cache=$(pnpm store path --silent)" >> $GITHUB_OUTPUT 
26+           echo "key=${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}" >> $GITHUB_OUTPUT 
27+        - name : Cache NPM and Cypress 📦 
28+         uses : actions/cache@v3 
29+         id : cache 
30+         with :
31+           path : | 
32+             ${{ steps.vars.outputs.pnpm-cache }} 
33+             ~/.cache/Cypress 
34+            key : ${{ steps.vars.outputs.key }} 
35+           restore-keys : | 
36+             ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} 
37+             ${{ runner.os }}-pnpm- 
38+        - run : pnpm install --frozen-lockfile --prefer-offline 
39+         env :
40+           HUSKY : ' 0'   #  By default do not run HUSKY install
2241
2342  lint :
2443    name : lint 
3049      - uses : actions/setup-node@v3 
3150        with :
3251          node-version : " 18.x" 
33-           cache : ' pnpm' 
34-       - run : pnpm install 
52+       - name : Cache NPM and Cypress 📦 
53+         uses : actions/cache@v3 
54+         id : cache 
55+         with :
56+           path : | 
57+             ${{ needs.cache.outputs.pnpm-cache }} 
58+             ~/.cache/Cypress 
59+            key : ${{ needs.cache.outputs.key }} 
60+           restore-keys : | 
61+             ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} 
62+             ${{ runner.os }}-pnpm- 
63+        - run : pnpm install --frozen-lockfile --prefer-offline 
64+         env :
65+           HUSKY : ' 0'   #  By default do not run HUSKY install
3566      - run : pnpm lint:ci 
3667      - run : pnpm format:ci 
3768
@@ -45,13 +76,32 @@ jobs:
4576      - uses : actions/setup-node@v3 
4677        with :
4778          node-version : " 18.x" 
48-           cache : ' pnpm' 
49-       - run : pnpm install && cd ./examples/webpack && pnpm cypress install 
79+       - name : Cache NPM and Cypress 📦 
80+         uses : actions/cache@v3 
81+         id : cache 
82+         with :
83+           path : | 
84+             ${{ needs.cache.outputs.pnpm-cache }} 
85+             ~/.cache/Cypress 
86+            key : ${{ needs.cache.outputs.key }} 
87+           restore-keys : | 
88+             ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} 
89+             ${{ runner.os }}-pnpm- 
90+        - run : pnpm install --frozen-lockfile --prefer-offline 
91+         env :
92+           HUSKY : ' 0'   #  By default do not run HUSKY install
5093      - run : pnpm --filter cypress-plugin-visual-regression-diff -r build 
5194      - name : Test e2e 
5295        run : pnpm test:e2e:ci 
5396      - name : Test component-testing 
5497        run : pnpm test:ct:ci 
98+       - uses : actions/upload-artifact@v3 
99+         with :
100+           name : test 
101+           path : | 
102+             examples/next/**/*.png 
103+             examples/next/**/*.jpg 
104+             examples/next/**/*.jpeg 
55105
56106   test-integration-coverage :
57107    name : test-integration-coverage 
@@ -63,8 +113,20 @@ jobs:
63113      - uses : actions/setup-node@v3 
64114        with :
65115          node-version : " 18.x" 
66-           cache : ' pnpm' 
67-       - run : pnpm install 
116+       - name : Cache NPM and Cypress 📦 
117+         uses : actions/cache@v3 
118+         id : cache 
119+         with :
120+           path : | 
121+             ${{ needs.cache.outputs.pnpm-cache }} 
122+             ~/.cache/Cypress 
123+            key : ${{ needs.cache.outputs.key }} 
124+           restore-keys : | 
125+             ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} 
126+             ${{ runner.os }}-pnpm- 
127+        - run : pnpm install --frozen-lockfile --prefer-offline 
128+         env :
129+           HUSKY : ' 0'   #  By default do not run HUSKY install
68130      - name : Test integration (with coverage) and upload to CodeClimate 
69131        if : ${{ github.ref == 'refs/heads/main' }} 
70132@@ -100,18 +162,30 @@ jobs:
100162  build-and-release :
101163    name : build and release 
102164    runs-on : ubuntu-latest 
103-     needs : prepare-release 
165+     needs : [cache,  prepare-release] 
104166    if : needs.prepare-release.outputs.releases_created 
105167    steps :
106168      - uses : actions/checkout@v3 
107169108170      - uses : actions/setup-node@v3 
109171        with :
110172          node-version : " 18.x" 
111-           cache : ' pnpm' 
112173          registry-url : ' https://registry.npmjs.org' 
113174          NPM_TOKEN : ${{ secrets.NPM_TOKEN }} 
114-       - run : pnpm install 
175+       - name : Cache NPM and Cypress 📦 
176+         uses : actions/cache@v3 
177+         id : cache 
178+         with :
179+           path : | 
180+             ${{ needs.cache.outputs.pnpm-cache }} 
181+             ~/.cache/Cypress 
182+            key : ${{ needs.cache.outputs.key }} 
183+           restore-keys : | 
184+             ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} 
185+             ${{ runner.os }}-pnpm- 
186+        - run : pnpm install --frozen-lockfile --prefer-offline 
187+         env :
188+           HUSKY : ' 0'   #  By default do not run HUSKY install
115189      - name : Build packages to get cross-references working 🔧 
116190        run : pnpm build 
117191      - name : Release package 
0 commit comments