Skip to content

Commit db48f4b

Browse files
committed
By default do not cache Playwright binaries
1 parent e0c65d8 commit db48f4b

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# euclidpower/setup-dependencies-action
2+
3+
Reduce the duplication when setting up jobs.
4+
5+
This tool allows you to setup ruby, nodejs and playwright.
6+
7+
# How to use it
8+
9+
```yml
10+
jobs:
11+
your-new-job:
12+
name: A descriptive name
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: euclidpower/setup-dependencies-action@v3
18+
with:
19+
cache_playwright: true # optional, defaults to "0"
20+
21+
```
22+
23+
# Development
24+
1. Clone the repo
25+
2. Write your changes
26+
3. Create a commit
27+
4. Add a new tag, for example for "v4": `git tag -a -f -m "A description of this new release" v4`
28+
5. Push the tags to origin
29+
6. Confirm the changes work as expected in your codebase. If they don't, you can delete the tag and repeat the process from step 3

action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Set up and cache Ruby and NodeJS
22
description: Setting up and caching dependencies of euclidpower/webapp
3+
inputs:
4+
cache_playwright:
5+
description: Should Cache Playwright binaries
6+
required: false
7+
default: "0"
38
runs:
49
using: composite
510
steps:
@@ -16,19 +21,21 @@ runs:
1621
shell: bash
1722

1823
- name: Get installed Playwright version
24+
if: inputs.cache_playwright != '0'
1925
run: echo "PLAYWRIGHT_VERSION=$(yarn list --pattern="@playwright/test" --json | jq '.data.trees[0].name' -r | sed 's/.*@//')" >> $GITHUB_ENV
2026
shell: bash
2127

2228
- name: Cache Playwright binaries
29+
if: inputs.cache_playwright != '0'
2330
uses: actions/cache@v4
2431
id: playwright-cache
2532
with:
2633
path: ~/.cache/ms-playwright
2734
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
2835
restore-keys: |
29-
${{ runner.os }}-playwright-
36+
${{ runner.os }}-playwright-
3037
3138
- name: Download Playwright dependencies and browsers
39+
if: inputs.cache_playwright != '0' && steps.playwright-cache.outputs.cache-hit != 'true'
3240
run: yarn playwright install --with-deps chromium
3341
shell: bash
34-
if: steps.playwright-cache.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)