diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 272a7338e6f..82e0d75f528 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Check code run: npm run check - name: Lint code @@ -126,7 +128,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Build packages run: npm run build --workspace @puppeteer-test/test - name: Setup cache for Chromium binary @@ -182,7 +186,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Build packages run: npm run build --workspace @puppeteer-test/test - name: Setup cache for Firefox binary @@ -230,7 +236,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Build installation test run: npm run build --workspace @puppeteer-test/installation - name: Pack installation test @@ -310,7 +318,9 @@ jobs: cache: npm node-version: ${{ matrix.node }} - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Build packages run: npm run build --workspace puppeteer - name: Pack packages @@ -338,7 +348,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Run tests run: npm run test --workspace @puppeteer/ng-schematics @@ -363,7 +375,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Run tests run: npm run test --workspace @puppeteer/browsers diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8a7265cf31e..cd30f498e28 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,9 @@ jobs: - name: Check out repository uses: actions/checkout@v3.0.2 - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Build packages run: npm run build - name: Set npm registry @@ -51,7 +53,9 @@ jobs: - name: Check out repository uses: actions/checkout@v3.0.2 - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Build packages run: npm run build - name: Pack packages for docker diff --git a/.github/workflows/tot-ci.yml b/.github/workflows/tot-ci.yml index 6fed514899a..05abd8fcd7f 100644 --- a/.github/workflows/tot-ci.yml +++ b/.github/workflows/tot-ci.yml @@ -34,7 +34,9 @@ jobs: cache: npm node-version: latest - name: Install dependencies - run: npm ci --ignore-scripts + run: npm ci + env: + PUPPETEER_SKIP_DOWNLOAD: true - name: Install linux dependencies. run: sudo apt-get install xvfb - name: Build packages diff --git a/packages/puppeteer/install.js b/packages/puppeteer/install.js index 7797281196e..bb024e49bfe 100644 --- a/packages/puppeteer/install.js +++ b/packages/puppeteer/install.js @@ -35,6 +35,9 @@ if (!fs.existsSync(path.join(__dirname, 'lib'))) { execSync('npm run build --workspace puppeteer'); } -const {downloadBrowser} = require('puppeteer/internal/node/install.js'); - -downloadBrowser(); +try { + const {downloadBrowser} = require('puppeteer/internal/node/install.js'); + downloadBrowser(); +} catch (err) { + console.warn('Browser download failed', err); +}