@@ -113,21 +113,46 @@ jobs:
113
113
path : outfile.cjs
114
114
key : ${{ github.sha }}-${{ hashFiles('pnpm-lock.yaml') }}
115
115
- name : Build the package on cache miss
116
- if : steps.cache.outputs.cache-hit != 'true'
116
+ if : steps.cache-restore .outputs.cache-hit != 'true'
117
117
run : pnpm install && pnpm build
118
- env :
119
- CYPRESS_INSTALL_BINARY : 0
118
+
119
+ # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
120
+ # Install playwright's binary under custom directory to cache
121
+ - name : Set Playwright & Cypress path
122
+ if : runner.os != 'Windows'
123
+ run : |
124
+ echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
125
+ echo "CYPRESS_CACHE_FOLDER=$HOME/.cache/cypress-bin" >> $GITHUB_ENV
126
+ - name : Set Playwright & Cypress path (windows)
127
+ if : runner.os == 'Windows'
128
+ run : |
129
+ echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
130
+ echo "CYPRESS_CACHE_FOLDER=$HOME\.cache\cypress-bin" >> $env:GITHUB_ENV
131
+
132
+ - name : Cache Cypress binaries
133
+ id : cache-cypress
134
+ uses : actions/cache@v3
135
+ with :
136
+ key : ${{ runner.os }}-cypress-bin
137
+ path : ${{ env.CYPRESS_CACHE_FOLDER }}
138
+
139
+ - name : Cache Playwright's binary
140
+ uses : actions/cache@v3
141
+ with :
142
+ # Playwright removes unused browsers automatically
143
+ # So does not need to add playwright version to key
144
+ key : ${{ runner.os }}-playwright-bin-v1
145
+ path : ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
120
146
121
147
- if : ${{ (contains(env.FEATURE_FLAGS, '--')) }}
122
148
name : Create the sample project with feature flags
123
- run : node ./outfile.cjs sample-project ${{ env.FEATURE_FLAGS }}
149
+ working-directory : ../
150
+ run : node ./create-vue/outfile.cjs sample-project ${{ env.FEATURE_FLAGS }}
124
151
125
152
- if : ${{ !(contains(env.FEATURE_FLAGS, '--')) }}
126
153
name : Create the sample project with default options
127
- run : node ./outfile.cjs sample-project --default
128
-
129
- - name : Move the sample project to the upper-level directory
130
- run : mv sample-project ../sample-project
154
+ working-directory : ../
155
+ run : node ./create-vue/outfile.cjs sample-project --default
131
156
132
157
- name : Install dependencies in the sample project
133
158
working-directory : ../sample-project
@@ -142,6 +167,11 @@ jobs:
142
167
working-directory : ../sample-project
143
168
run : pnpm build
144
169
170
+ - name : Force download Cypress on cache miss
171
+ if : ${{ contains(matrix.flag-for-e2e, '--cypress') && steps.cache-cypress.outputs.cache-hit != 'true'}}
172
+ working-directory : ../sample-project
173
+ run : pnpm exec cypress install --force
174
+
145
175
- if : ${{ contains(matrix.flag-for-e2e, '--playwright') }}
146
176
name : Install Playwright dependencies
147
177
working-directory : ../sample-project
0 commit comments