Skip to content

Commit

Permalink
By default do not cache Playwright binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
cmolina committed Feb 1, 2024
1 parent e0c65d8 commit db48f4b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# euclidpower/setup-dependencies-action

Reduce the duplication when setting up jobs.

This tool allows you to setup ruby, nodejs and playwright.

# How to use it

```yml
jobs:
your-new-job:
name: A descriptive name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: euclidpower/setup-dependencies-action@v3
with:
cache_playwright: true # optional, defaults to "0"

```

# Development
1. Clone the repo
2. Write your changes
3. Create a commit
4. Add a new tag, for example for "v4": `git tag -a -f -m "A description of this new release" v4`
5. Push the tags to origin
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
11 changes: 9 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Set up and cache Ruby and NodeJS
description: Setting up and caching dependencies of euclidpower/webapp
inputs:
cache_playwright:
description: Should Cache Playwright binaries
required: false
default: "0"
runs:
using: composite
steps:
Expand All @@ -16,19 +21,21 @@ runs:
shell: bash

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

- name: Cache Playwright binaries
if: inputs.cache_playwright != '0'
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
restore-keys: |
${{ runner.os }}-playwright-
${{ runner.os }}-playwright-
- name: Download Playwright dependencies and browsers
if: inputs.cache_playwright != '0' && steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps chromium
shell: bash
if: steps.playwright-cache.outputs.cache-hit != 'true'

0 comments on commit db48f4b

Please sign in to comment.