From c28d2ff86315aed8b5376e0dddd7c13cf5dc96b3 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 16 May 2022 19:33:16 +0200 Subject: [PATCH] ci: speed up by caching chromium (#193) --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a47d3d18..bd0d95f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,11 +35,35 @@ jobs: - name: Cache dependencies run: deno cache --no-check src/cli/deps.ts src/runtime/deps.ts src/server/deps.ts - - name: Setup puppeteer linux / mac + - name: Cache Chrome (Linux) + if: startsWith(matrix.os, 'ubuntu') + uses: actions/cache@v2 + with: + path: ~/.cache/deno/deno_puppeteer + key: chrome-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }} + restore-keys: chrome-${{ runner.os }}- + + - name: Cache Chrome (macOS) + if: startsWith(matrix.os, 'mac') + uses: actions/cache@v2 + with: + path: ~/Library/Caches/deno/deno_puppeteer + key: chrome-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }} + restore-keys: chrome-${{ runner.os }}- + + - name: Cache Chrome (Windows) + if: startsWith(matrix.os, 'win') + uses: actions/cache@v2 + with: + path: "C:\\Users\\RUNNER~1\\AppData\\Local\\deno\\deno_puppeteer" + key: chrome-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }} + restore-keys: chrome-${{ runner.os }}- + + - name: Install Chromium (Unix) if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'mac') run: PUPPETEER_PRODUCT=chrome deno run -A --unstable https://deno.land/x/puppeteer@9.0.2/install.ts - - name: Setup puppeteer windows + - name: Install Chromium (Windows) if: startsWith(matrix.os, 'windows') run: set "PUPPETEER_PRODUCT=chrome" && deno run -A --unstable https://deno.land/x/puppeteer@9.0.2/install.ts