-
-
Notifications
You must be signed in to change notification settings - Fork 66
75 lines (65 loc) · 2.07 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
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: ${{ matrix.runtime }} ${{ matrix.os }} deno-${{ matrix.deno }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
runtime: [deno, node]
os: [macOS-latest, windows-latest, ubuntu-latest]
deno_version: [v1.x, rc]
env:
RUST_BACKTRACE: full
DENO_FUTURE: 1
CLIFFY_SNAPSHOT_DELAY: 2000
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}
# deno-version-file: ".deno-version"
- name: Create package.json
if: ${{ matrix.runtime == 'node' || matrix.runtime == 'bun' }}
run: deno task setup:${{ matrix.runtime }} --no-install
- name: Setup Node
if: ${{ matrix.runtime == 'node' }}
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- name: Setup Bun
if: ${{ matrix.runtime == 'bun' }}
uses: oven-sh/setup-bun@v2
with:
bun-version-file: ".bun-version"
- name: Setup pnpm
if: ${{ matrix.runtime == 'node' }}
uses: pnpm/action-setup@v4
- name: Install deps
run: deno task setup:${{ matrix.runtime }}
- name: Run tests
if: matrix.runtime == 'deno' && matrix.deno_version == 'v1.x'
shell: bash
run: deno task coverage:deno-v1
- name: Run tests
if: matrix.runtime == 'deno' && matrix.deno_version == 'rc'
shell: bash
run: deno task coverage:deno-v2
- name: Run tests
if: matrix.runtime != 'deno'
shell: bash
run: deno task coverage:${{ matrix.runtime }}
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
name: ${{ matrix.runtime }}-${{ matrix.os }}
files: dist/coverage/${{ matrix.module }}/cov.lcov
flags: ${{ matrix.runtime }}
token: ${{ secrets.CODECOV_TOKEN }}