Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa2c596

Browse files
committed
ci: add cypress & playwright binary caches
1 parenta2cb3e9 commitfa2c596

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

‎.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,39 @@ jobs:
113113
path:outfile.cjs
114114
key:${{ github.sha }}-${{ hashFiles('pnpm-lock.yaml') }}
115115
-name:Build the package on cache miss
116-
if:steps.cache.outputs.cache-hit != 'true'
116+
if:steps.cache-restore.outputs.cache-hit != 'true'
117117
run:pnpm install && pnpm build
118118
env:
119+
# The main project doesn't need Cypress binaries
119120
CYPRESS_INSTALL_BINARY:0
120121

122+
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
123+
# Install playwright's binary under custom directory to cache
124+
-name:Set Playwright & Cypress path
125+
if:runner.os != 'Windows'
126+
run:|
127+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
128+
echo "CYPRESS_CACHE_FOLDER=$HOME/.cache/cypress-bin" >> $GITHUB_ENV
129+
-name:Set Playwright & Cypress path (windows)
130+
if:runner.os == 'Windows'
131+
run:|
132+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
133+
echo "CYPRESS_CACHE_FOLDER=$HOME\.cache\cypress-bin" >> $env:GITHUB_ENV
134+
135+
-name:Cache Cypress binaries
136+
uses:actions/cache@v3
137+
with:
138+
key:${{ runner.os }}-cypress-bin
139+
path:${{ env.CYPRESS_CACHE_FOLDER }}
140+
141+
-name:Cache Playwright's binary
142+
uses:actions/cache@v3
143+
with:
144+
# Playwright removes unused browsers automatically
145+
# So does not need to add playwright version to key
146+
key:${{ runner.os }}-playwright-bin-v1
147+
path:${{ env.PLAYWRIGHT_BROWSERS_PATH }}
148+
121149
-if:${{ (contains(env.FEATURE_FLAGS, '--')) }}
122150
name:Create the sample project with feature flags
123151
run:node ./outfile.cjs sample-project ${{ env.FEATURE_FLAGS }}
@@ -142,6 +170,7 @@ jobs:
142170
working-directory:../sample-project
143171
run:pnpm build
144172

173+
145174
-if:${{ contains(matrix.flag-for-e2e, '--playwright') }}
146175
name:Install Playwright dependencies
147176
working-directory:../sample-project

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp