Skip to content

Merge pull request #6 from frytg/dev/date-duration #23

Merge pull request #6 from frytg/dev/date-duration

Merge pull request #6 from frytg/dev/date-duration #23

Workflow file for this run

# adapted from https://github.com/denoland/std/blob/main/.github/workflows/workspace_publish.yml
name: ci
on:
push:
branches:
- main
- dev/*
- chore/*
- feature/*
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
env:
JSR_DEPENDENCIES: "@cross/test @std/assert @std/fmt @frytg/logger @frytg/dates"
NPM_DEPENDENCIES: "luxon sinon"
jobs:
test-on-deno-and-lint:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: Set line ending for Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Deno
uses: denoland/setup-deno@v2
with:
deno-version: canary
- name: Deno version
run: deno --version
- name: Install dependencies
run: deno install --vendor
- name: Format & Check
run: deno run check
- name: Test
run: deno run test
- name: Publish dry run
run: deno publish --dry-run
if: matrix.os == 'ubuntu-latest'
test-on-bun:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: Set line ending for Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Bun version
run: bun --version
- name: Install JSR dependencies
run: bunx jsr add ${{ env.JSR_DEPENDENCIES }}
- name: Install NPM dependencies
run: bun add ${{ env.NPM_DEPENDENCIES }}
- name: Test
run: bun test
test-on-node:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
node-version:
- 20
- 22
- 23
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: Set line ending for Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- name: Clone repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Node version
run: node --version
- name: Install JSR dependencies
run: npx jsr add ${{ env.JSR_DEPENDENCIES }}
- name: Install NPM dependencies
run: npm install ${{ env.NPM_DEPENDENCIES }}
- name: Set up package.json
run: 'echo ''{ "type": "module" }'' > package.json'
- name: Test (Windows)
if: matrix.os == 'windows-latest'
run: |
$files = npx --yes glob "**/*.test.ts"
foreach ($file in $files) {
npx tsx --test $file
}
shell: pwsh
- name: Test (Linux/macOS)
if: matrix.os != 'windows-latest'
run: npx --yes tsx --test **/*.test.ts