Skip to content

Commit d9385fc

Browse files
Freakyzyc9012
authored andcommitted
Fix CI for earlier node versions
Node hardcodes its default TLS certificates, meaning older versions do not support the root certificate currently used by LetsEncrypt. Use --use-openssl-ca to enable the use of the system's OpenSSL certificates. Since node v7 doesn't support NODE_OPTIONS, conditionally modify the test script with sed.
1 parent 7610f9f commit d9385fc

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/build.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
66
build:
@@ -52,6 +52,15 @@ jobs:
5252
strategy:
5353
matrix:
5454
node-version: [7.x, 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
55+
include:
56+
- command: test
57+
- command: test:use-openssl-ca
58+
node-version: 7.x
59+
- command: test:use-openssl-ca
60+
node-version: 8.x
61+
- command: test:use-openssl-ca
62+
node-version: 9.x
63+
5564
steps:
5665
- name: Checkout repo
5766
uses: actions/checkout@v3
@@ -76,7 +85,7 @@ jobs:
7685
run: |
7786
cd smoke_tests/commonjs
7887
npm i
79-
npm test
88+
npm run ${{ matrix.command }}
8089
8190
smoke-tests-esm:
8291
name: "Smoke tests (ESM)"

smoke_tests/commonjs/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"serpapi": "../../npm"
55
},
66
"scripts": {
7-
"test": "node commonjs.js"
7+
"test": "node commonjs.js",
8+
"test:use-openssl-ca": "node --use-openssl-ca commonjs.js"
89
}
910
}

0 commit comments

Comments
 (0)