name: Test
on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize]

jobs:
  node:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
          cache: npm
      - run: npm ci
      - run: npm test
  deno:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
          cache: npm
      - uses: denoland/setup-deno@v1
        with:
          deno-version: v1.x
      - run: npm ci
      - run: npm run build:default
      - run: npm run test:deno
