Skip to content

Commit

Permalink
Attempt to fix CI for earlier node versions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Freaky committed Mar 11, 2024
1 parent 7610f9f commit 7d2266f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ jobs:
- name: Run smoke tests
env:
SERPAPI_TEST_KEY: ${{ secrets.SERPAPI_TEST_KEY }}
NODE_OPTIONS: --use-openssl-ca
run: |
cd smoke_tests/commonjs
if [ "$(node -v)" == "v7.10.1" ]; then
sed -i.orig -e 's/node commonjs.js/node --use-openssl-ca commonjs.js/' package.json
fi
npm i
npm test
Expand Down

0 comments on commit 7d2266f

Please sign in to comment.