96 lines
3.1 KiB
YAML
96 lines
3.1 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore: [www/**]
|
|
pull_request:
|
|
branches: [main]
|
|
paths-ignore: [www/**]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
|
|
strategy:
|
|
matrix:
|
|
# FIXME: temporarially disabled 1.x until https://github.com/denoland/deno/commit/64e072e499d36ca824db297a493667415ed67cdf is released
|
|
deno: ["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 == 'v1.x'
|
|
run: deno fmt --check
|
|
|
|
- name: Run linter
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'canary'
|
|
run: deno lint
|
|
|
|
- name: Cache dependencies
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v1.x'
|
|
run: deno cache --no-check --import-map=./www/import_map.json src/dev/deps.ts src/server/deps.ts www/main.ts
|
|
|
|
- name: Cache Chrome (Linux)
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
uses: actions/cache@v2
|
|
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@v2
|
|
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@v2
|
|
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 }}-
|
|
|
|
- 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@16.2.0/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@16.2.0/install.ts
|
|
|
|
- name: Run tests
|
|
run: deno test -A
|
|
|
|
- name: Type check init script
|
|
run: deno check --remote init.ts
|
|
|
|
- name: Type check website
|
|
run: deno check main.ts dev.ts
|
|
working-directory: www/
|
|
|
|
- name: Type check examples/counter
|
|
run: deno check --remote main.ts dev.ts
|
|
working-directory: examples/counter
|
|
|
|
- name: Type check tests/fixture
|
|
run: deno check main.ts dev.ts
|
|
working-directory: tests/fixture/
|
|
|
|
- name: Type check tests/fixture_error
|
|
run: deno check main.ts dev.ts
|
|
working-directory: tests/fixture_error/
|