-
Notifications
You must be signed in to change notification settings - Fork 2
190 lines (151 loc) · 4.27 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: CI
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Run unittests.ts
run: |
deno test --coverage=testdata/coverage --unstable -A tests/unittests.ts
- name: Run test.ts
run: |
mkdir -p testdata
deno test \
--allow-read=testdata --allow-write=testdata \
--allow-env \
--coverage=testdata/coverage \
tests/test.ts
- name: Analyze coverage
run: |
deno coverage testdata/coverage --lcov > testdata/coverage.lcov
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./testdata/coverage.lcov
fail_ci_if_error: true
name: test
test-in-memory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Run test.ts
run: |
mkdir -p testdata
deno test \
--allow-read=testdata --allow-write=testdata \
--allow-env \
--coverage=testdata/coverage \
tests/test.ts -- --in-memory
- name: Analyze coverage
run: |
deno coverage testdata/coverage --lcov > testdata/coverage.lcov
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./testdata/coverage.lcov
fail_ci_if_error: true
name: test-in-memory
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Check fmt
run: deno fmt --check
node:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14', '16' ]
name: node v${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Setup Node v${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install deps with pnpm
run: |
curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6
pnpm install --frozen-lockfile
- name: Build bundle for Node
run: |
pnpm run build
- name: Upload bundle to artifact
uses: actions/upload-artifact@v2
with:
name: btrdb-node
path: |
dist/btrdb.*
dist/nodeTest.*
- name: Run tests in Node
run: |
mkdir -p testdata
node nodeCompat/example.js && \
pnpm run nodetest
perf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Run test.ts without "deno test"
run: |
mkdir -p testdata
deno run --allow-read=testdata --allow-write=testdata tests/test.ts run
test-pagesize:
runs-on: ubuntu-latest
strategy:
matrix:
page_size:
- 128
- 256
- 512
- 1024
- 2048
- 4096
steps:
- uses: actions/checkout@v2
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- name: Run test.ts (page size ${{ matrix.page_size }})
run: |
BTRDB_PAGESIZE=${{ matrix.page_size }} \
deno test \
--allow-read=testdata --allow-write=testdata \
--allow-env \
--coverage=testdata/coverage \
tests/test.ts -- --in-memory
- name: Analyze coverage
run: |
deno coverage testdata/coverage --lcov > testdata/coverage.lcov
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./testdata/coverage.lcov
fail_ci_if_error: true
name: pagesize-${{ matrix.page_size }}