diff --git a/README.md b/README.md new file mode 100644 index 0000000..684f7bf --- /dev/null +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 56d41e5..f1d911d 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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'