fix: test on windows #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
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: Install dependencies | |
run: deno install --vendor | |
- name: Format & Check | |
run: deno run check | |
- name: Test | |
run: deno 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 @cross/test @std/assert | |
- name: Install NPM dependencies | |
run: bun add luxon | |
- 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: Install JSR dependencies | |
run: npx jsr add @cross/test @std/assert | |
- name: Install NPM dependencies | |
run: npm install luxon | |
- name: Node version | |
run: node --version | |
- name: Set up package.json | |
run: 'echo ''{ "type": "module" }'' > package.json' | |
- name: Test (Windows) | |
if: matrix.os == 'windows-latest' | |
run: npx --yes glob '**/*.test.ts' | xargs npx tsx --test -- | |
- name: Test (Linux/macOS) | |
if: matrix.os != 'windows-latest' | |
run: npx --yes tsx --test **/*.test.ts |