Skip to content

Commit 3aba379

Browse files
authored
Use github actions for CI (brianc#2654)
This is the initial port to github actions. Still pending are the SSL and client SSL cert tests which are currently being skipped. But perfect is the enemy of the good here, and having no CI because travis-ci keeps not working is unacceptable.
1 parent 947ccee commit 3aba379

File tree

3 files changed

+251
-202
lines changed

3 files changed

+251
-202
lines changed

.github/workflows/ci.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
services:
9+
postgres:
10+
image: postgres:11
11+
env:
12+
POSTGRES_USER: postgres
13+
POSTGRES_PASSWORD: postgres
14+
POSTGRES_DB: ci_db_test
15+
ports:
16+
- 5432:5432
17+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
18+
strategy:
19+
matrix:
20+
node: ['8', '10', '12', '14', '16', '17']
21+
name: Node ${{ matrix.node }}
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Setup node
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: ${{ matrix.node }}
28+
cache: yarn
29+
- run: yarn install
30+
# TODO(bmc): get ssl tests working in ci
31+
- run: PGTESTNOSSL=true PGUSER=postgres PGPASSWORD=postgres PGDATABASE=ci_db_test yarn test

packages/pg-query-stream/test/async-iterator.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,16 @@ if (!process.version.startsWith('v8')) {
8888
rows.push(row)
8989
break
9090
}
91-
for await (const row of stream) {
92-
rows.push(row)
93-
}
94-
for await (const row of stream) {
95-
rows.push(row)
91+
92+
try {
93+
for await (const row of stream) {
94+
rows.push(row)
95+
}
96+
for await (const row of stream) {
97+
rows.push(row)
98+
}
99+
} catch (e) {
100+
// swallow error - node 17 throws if stream is aborted
96101
}
97102
assert.strictEqual(rows.length, 1)
98103
client.release()

0 commit comments

Comments
 (0)