chore(CI): fix and simplify caching (#1571)

This commit is contained in:
Asher Gomez
2023-08-02 09:44:42 +02:00
committed by GitHub
parent ecb718b6a7
commit 5e78224f49
9 changed files with 28 additions and 49 deletions
+16 -29
View File
@@ -16,6 +16,13 @@ jobs:
matrix:
deno: ["v1.x", "canary"]
os: [macOS-latest, windows-latest, ubuntu-latest]
include:
- os: ubuntu-latest
cache_path: ~/.cache/deno/
- os: macos-latest
cache_path: ~/Library/Caches/deno/
- os: windows-latest
cache_path: ~\AppData\Local\deno\
steps:
- name: Checkout repo
@@ -36,36 +43,13 @@ jobs:
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'canary'
uses: crate-ci/typos@master
- name: Type check project
run: deno task check:types
- name: Cache dependencies
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v1.x'
run: deno cache --config=www/deno.json src/dev/deps.ts src/server/deps.ts www/main.ts
- name: Cache Chrome (Linux)
if: startsWith(matrix.os, 'ubuntu')
- name: Cache dependencies and Chrome
uses: actions/cache@v3
with:
path: ~/.cache/deno/deno_puppeteer
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
restore-keys: chrome-1022525-${{ runner.os }}-
- name: Cache Chrome (macOS)
if: startsWith(matrix.os, 'mac')
uses: actions/cache@v3
with:
path: ~/Library/Caches/deno/deno_puppeteer
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
restore-keys: chrome-1022525-${{ runner.os }}-
- name: Cache Chrome (Windows)
if: startsWith(matrix.os, 'win')
uses: actions/cache@v3
with:
path: "C:\\Users\\RUNNER~1\\AppData\\Local\\deno\\deno_puppeteer"
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
restore-keys: chrome-1022525-${{ runner.os }}-
path: |
${{ matrix.cache_path }}deps
${{ matrix.cache_path }}deno_puppeteer
key: ${{ runner.os }}-${{ hashFiles('**/*deps.ts', 'tests/fixture_twind_hydrate/twind.config.ts') }}
- name: Install Chromium (Unix)
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'mac')
@@ -75,6 +59,9 @@ jobs:
if: startsWith(matrix.os, 'windows')
run: set "PUPPETEER_PRODUCT=chrome" && deno run -A --unstable https://deno.land/x/puppeteer@16.2.0/install.ts
- name: Type check project
run: deno task check:types
- name: Run tests
run: deno test -A
@@ -87,4 +74,4 @@ jobs:
- name: Type check demo
run: deno check --remote main.ts dev.ts
working-directory: demo
working-directory: demo