-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (131 loc) · 3.7 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# 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/check-required-env"
# NPM_DEPENDENCIES: "luxon minio 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: Set up Deno
uses: denoland/setup-deno@v2
with:
deno-version: canary
- name: Install dependencies
run: deno install --vendor
- 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: Set up Deno
uses: denoland/setup-deno@v2
with:
deno-version: canary
- name: Install dependencies
run: deno install --vendor
- 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