Skip to content

ci: CI on both Node 22 and Deno 2 #133

ci: CI on both Node 22 and Deno 2

ci: CI on both Node 22 and Deno 2 #133

Workflow file for this run

name: 'CI'
on: [ push ]
jobs:
build_node:
name: "Build"
strategy:
matrix:
runtime: [ 'Node.js v22' ]
runs-on: ubuntu-latest
steps:
- name: 'Clone repository'
uses: actions/checkout@v4
- name: 'Install Node.js'
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: 'npm ci'
run: npm ci
- name: 'npm run check-types'
run: npm run check-types
- name: 'npm run lint'
run: npm run lint
- name: 'npm run test'
run: npm run test:ci
# todo: convert test:ci to a convention for env var detection "e.g. CI=true"
- name: 'Publish coverage badge'
uses: wjervis7/vitest-badge-action@v1.0.0
with:
result-type: lines
gist-token: ${{ secrets.RELEASE_PLEASE_TOKEN }} # if you want to upload badge to gist
gist-url: https://gist.github.com/dirkluijk/db6fbd0d0d4c138655a89386c5bdbe41
upload-badge: ${{ github.ref == 'refs/heads/main' }}
badge-text: 'coverage'
build_deno:
name: "Build"
strategy:
matrix:
runtime: [ 'Deno v2' ]
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
env:
DENO_DIR: '../.deno'
steps:
- name: 'Clone repository'
uses: actions/checkout@v4
- name: 'Install Deno'
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: 'deno install'
run: deno install
- name: 'cache Deno dir'
uses: actions/cache@v2
with:
path: ${{ env.DENO_DIR }}
key: deno_dir
- name: 'deno check'
run: deno check **/*.ts
- name: 'deno lint'
run: deno run lint
- name: 'deno test'
# todo: use "deno run test:ci" when released:
# https://github.com/denoland/deno/pull/26836
run: deno run test