-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (69 loc) · 2.05 KB
/
ci.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
name: 'CI'
on: [ push ]
jobs:
ci_node:
name: "CI on Node.js"
strategy:
matrix:
version: [20, 22, 23]
runs-on: ubuntu-latest
steps:
- name: 'Clone repository'
uses: actions/checkout@v4
- name: 'Install Node.js'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
cache: 'npm'
- name: 'npm ci'
run: npm ci
- name: 'npm run check-types'
run: npm run check-types
- name: 'npm run lint'
run: npm run lint
- name: 'npm run test'
run: npm run test:ci
# todo: convert test:ci to a convention for env var detection "e.g. CI=true"
- name: 'Publish coverage badge'
uses: wjervis7/vitest-badge-action@v1.0.0
with:
result-type: lines
gist-token: ${{ secrets.RELEASE_PLEASE_TOKEN }} # if you want to upload badge to gist
gist-url: https://gist.github.com/dirkluijk/db6fbd0d0d4c138655a89386c5bdbe41
upload-badge: ${{ github.ref == 'refs/heads/main' }}
badge-text: 'coverage'
ci_deno:
name: "CI on Deno"
strategy:
matrix:
version: ['v2.x']
runs-on: ubuntu-latest
env:
DENO_DIR: '/tmp/.deno'
steps:
- name: 'Clone repository'
uses: actions/checkout@v4
- name: 'Install Deno'
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.version }}
- name: 'restore .deno dir'
uses: actions/cache/restore@v4
with:
path: ${{ env.DENO_DIR }}
key: deno_dir
- name: 'deno install'
run: deno install
- name: 'cache .deno dir'
uses: actions/cache/save@v4
with:
path: ${{ env.DENO_DIR }}
key: deno_dir
- name: 'deno check'
run: deno check **/*.ts
- name: 'deno lint'
run: deno run lint
- name: 'deno test'
# todo: use "deno run test:ci" when released:
# https://github.com/denoland/deno/pull/26836
run: deno run test