-
Notifications
You must be signed in to change notification settings - Fork 26
109 lines (102 loc) · 3.6 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
name: node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
with:
node-version: lts/*
cache: 'npm'
- run: npm ci
- run: npm run prepublishOnly
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3
with:
name: build-output
path: |
dist/
lib/
umd/
prod-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- id: prod-deps
uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
with:
path: ./node_modules
key: prod-deps-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.prod-deps.outputs.cache-hit != 'true'
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
with:
node-version: lts/*
- if: steps.prod-deps.outputs.cache-hit != 'true'
run: npm install --omit=dev --ignore-scripts
# Disabled until the jest runtime works with ESM
# edge-runtime:
# runs-on: ubuntu-latest
# needs: [build, prod-deps]
# steps:
# - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
# - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
# with:
# node-version: lts/*
# cache: 'npm'
# cache-dependency-path: runtimes/edge/package-lock.json
# - uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
# with:
# path: ./node_modules
# key: prod-deps-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
# - uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # tag=v3
# with:
# name: build-output
# - run: npm ci
# working-directory: runtimes/edge
# - run: npm test
# working-directory: runtimes/edge
deno-runtime:
runs-on: ubuntu-latest
needs: [build, prod-deps]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ./node_modules
key: prod-deps-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- uses: actions/download-artifact@v3
with:
name: build-output
- uses: denoland/setup-deno@v1
- name: deno test
run: |
deno fmt --check
deno lint
deno task test
working-directory: runtimes/deno
bun-runtime:
runs-on: ubuntu-latest
needs: [build, prod-deps]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda # tag=v3
with:
path: ./node_modules
key: prod-deps-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- uses: antongolub/action-setup-bun@bc198f5cb868ce282f0a72bdd7da3a06a5387f83 # tag=v1
- run: bun wiptest
working-directory: runtimes/bun