The `denoland/setup-deno` action recently added built-in caching (https://github.com/denoland/setup-deno/pull/89, https://github.com/denoland/setup-deno/pull/98). This makes it a lot simpler to add caching of the `DENO_DIR` during CI runs, without needing `@actions/cache` manual setup. This should speed up CI runs by avoiding downloading dependencies between every run.
57 lines
1.3 KiB
YAML
57 lines
1.3 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: ["v2.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
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Deno
|
|
uses: denoland/setup-deno@v2
|
|
with:
|
|
cache: true
|
|
deno-version: ${{ matrix.deno }}
|
|
|
|
- name: Verify formatting
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v2.x'
|
|
run: deno fmt --check
|
|
|
|
- name: Run linter
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v2.x'
|
|
run: deno lint
|
|
|
|
- name: Spell-check
|
|
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v2.x'
|
|
uses: crate-ci/typos@master
|
|
|
|
- name: Type check project
|
|
run: deno task check:types
|
|
|
|
- name: Run tests
|
|
run: deno task test
|
|
|
|
- name: Check docs
|
|
run: deno task check:docs
|