Skip to content

Commit

Permalink
ci: cache also chromium installed by puppeteer (#134)
Browse files Browse the repository at this point in the history
* ci: cache also chromium installed by puppeteer

* ci: fix puppeteer version extraction

* ci: fix version reading

* ci: set puppeteer download base url to avoid hanging of postinstall script

see puppeteer/puppeteer#12833 for more information
  • Loading branch information
matteo-cristino authored Aug 6, 2024
1 parent e6f5964 commit 4a74013
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ jobs:
with:
node-version: 20
pnpm-version: 8
- run: echo "PUPPETEER_VERSION=$(pnpm ls puppeteer --json | jq '.[0].devDependencies.puppeteer.version' -r)" >> $GITHUB_ENV
shell: bash
- uses: actions/cache@v4
with:
path: ~/.cache/puppeteer/chrome
key: ${{ runner.os }}-puppeteer-chromium-${{ env.PUPPETEER_VERSION }}
restore-keys: ${{ runner.os }}-puppeteer-chromium-
- name: install chromium
run: |
# very bad, but I do not found any other way to run
# a postinstall script of an already installed package
pnpm -C node_modules/puppeteer run postinstall
env:
PUPPETEER_DOWNLOAD_BASE_URL: https://storage.googleapis.com/chrome-for-testing-public
- name: 🧪 Run the tests
run: pnpm run test

Expand Down

0 comments on commit 4a74013

Please sign in to comment.