Files
sweet/.github/workflows/ci.yml
T

78 lines
2.4 KiB
YAML

name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
deno: ["v1.x", "canary"]
os: [macOS-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}
- name: Verify formatting
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'canary'
run: deno fmt --check
- name: Run linter
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'canary'
run: deno lint
- name: Cache dependencies
run: deno cache --no-check src/cli/deps.ts src/runtime/deps.ts src/server/deps.ts
- 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: 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
- name: Run tests
run: deno test -A --no-check=remote
- name: Type check website
run: deno cache --no-check=remote www/main.ts
- name: Type check examples/counter
run: deno cache --no-check=remote examples/counter/main.ts