From d921297d32077e2652d02d767093778c327fcb18 Mon Sep 17 00:00:00 2001 From: Kshitij Thareja Date: Tue, 6 Aug 2024 21:52:25 +0530 Subject: [PATCH 1/2] Add puppeteer config for CI environments --- .github/workflows/visual_tests.yml | 4 ++++ .puppeteerrc.cjs | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 .puppeteerrc.cjs diff --git a/.github/workflows/visual_tests.yml b/.github/workflows/visual_tests.yml index ab05ef0e1..4ed63f11f 100644 --- a/.github/workflows/visual_tests.yml +++ b/.github/workflows/visual_tests.yml @@ -24,6 +24,8 @@ jobs: environment: percy_tests outputs: percy_url: ${{ steps.extract-url.outputs.percy_url }} + env: + CI: true steps: - uses: actions/checkout@v4 - name: Use Node.js @@ -41,6 +43,8 @@ jobs: run: | yarn --frozen-lockfile npm rebuild node-sass + - name: Download Chromium + run: npx puppeteer browsers install chrome - name: Extract jsdocs and environment info run: yarn pregenerate - name: Run visual tests diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs new file mode 100644 index 000000000..803d42815 --- /dev/null +++ b/.puppeteerrc.cjs @@ -0,0 +1,8 @@ +const { join } = require('path'); + +/** + * @type {import("puppeteer").Configuration} + */ +module.exports = { + cacheDirectory: process.env.CI ? join(__dirname, '.cache', 'puppeteer') : undefined, +}; From 2e713bccf1a3f395bf43a7d8cfb155d3bb7991ca Mon Sep 17 00:00:00 2001 From: Kshitij Thareja Date: Wed, 7 Aug 2024 17:05:06 +0530 Subject: [PATCH 2/2] Remove .puppeteerrc.cjs --- .github/workflows/visual_tests.yml | 2 -- .puppeteerrc.cjs | 8 -------- 2 files changed, 10 deletions(-) delete mode 100644 .puppeteerrc.cjs diff --git a/.github/workflows/visual_tests.yml b/.github/workflows/visual_tests.yml index 4ed63f11f..a9b9162dd 100644 --- a/.github/workflows/visual_tests.yml +++ b/.github/workflows/visual_tests.yml @@ -24,8 +24,6 @@ jobs: environment: percy_tests outputs: percy_url: ${{ steps.extract-url.outputs.percy_url }} - env: - CI: true steps: - uses: actions/checkout@v4 - name: Use Node.js diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs deleted file mode 100644 index 803d42815..000000000 --- a/.puppeteerrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -const { join } = require('path'); - -/** - * @type {import("puppeteer").Configuration} - */ -module.exports = { - cacheDirectory: process.env.CI ? join(__dirname, '.cache', 'puppeteer') : undefined, -};