This change removes the `www` workflow, simplifying CI to one workflow. This is made more accessible, thanks to #1281. This also fixes PR merging nits for when the affected files lie only within the `/www` folder. E.g. https://github.com/denoland/fresh/pull/1259#issuecomment-1586050738 The same checks in the `www` workflow are performed in the `ci` workflow.
94 lines
2.9 KiB
YAML
94 lines
2.9 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
deno: ["v1.x", "canary"]
|
|
os: [macOS-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v3
|
|
|
|
- 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 --config=www/deno.json src/dev/deps.ts src/server/deps.ts www/main.ts
|
|
|
|
- name: Cache Chrome (Linux)
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
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 }}-
|
|
|
|
- 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 --parallel
|
|
|
|
- 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 demo
|
|
run: deno check --remote main.ts dev.ts
|
|
working-directory: demo
|
|
|
|
- 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/
|