-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83fec44
commit 2edb2b3
Showing
3 changed files
with
54 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Install Playwright | ||
description: Install Playwright and dependencies with cache | ||
|
||
# https://github.com/microsoft/playwright/issues/7249 | ||
|
||
inputs: | ||
working-directory: | ||
description: Where to install Playwright | ||
default: ./ | ||
|
||
outputs: | ||
version: | ||
description: Installed version of Playwright | ||
value: ${{ steps.version.outputs.version }} | ||
cache-hit: | ||
description: Whether cache for Playwright was found | ||
value: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get Playwright version | ||
id: version | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') | ||
echo "Version: $VERSION" | ||
echo "PLAYWRIGHT_VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Cache Playwright | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: playwright-${{ env.PLAYWRIGHT_VERSION }} | ||
|
||
- name: Install Playwright and its dependencies | ||
shell: bash | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
working-directory: ${{ inputs.working-directory }} | ||
run: npx playwright install chromium --with-deps | ||
|
||
- name: Install just Playwright's dependencies | ||
shell: bash | ||
if: steps.cache.outputs.cache-hit == 'true' | ||
working-directory: ${{ inputs.working-directory }} | ||
run: npx playwright install-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters