Skip to content

Commit

Permalink
chore: update CI to include build+test:headless (#680)
Browse files Browse the repository at this point in the history
* chore: update CI to include build+test:headless

Because some of the dependabot / snyk PRs could update dependencies like
webpack and friends, these checks should be included for pull requests.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add NODE_OPTIONS=--openssl-legacy-provider

Signed-off-by: Lance Ball <lball@redhat.com>

* chore: update CI to only build for current

This commit modifies CI so that the build matrix only uses the two
previous releases, and runs a separate action for `current` (18x at the
moment). This is because some things changed in Node.js 18 and I need
to set an environment variable when building to avoid error. However,
setting this environment variable results in an error for older versions
of Node.js.

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
  • Loading branch information
lance authored Oct 12, 2022
1 parent 626038f commit 2017aad
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/nodejs-ci-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
branches: [ main ]

jobs:
build:
lts:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -32,6 +32,28 @@ jobs:
flag-name: run-${{ matrix.node-version }}
parallel: true

current:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x
- run: npm ci
- run: npm run build
- run: npm run test:headless
- run: npm test
- run: npx @pkgjs/support validate
- run: node_modules/nyc/bin/nyc.js report --reporter=lcovonly
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: run-current
parallel: true

finish:
needs: build
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"prepare": "husky install",
"prebuild": "npm run pretest",
"build": "./test/browser/generate-index.sh && npm run build:browser && npm run build:docs",
"build": "./test/browser/generate-index.sh && NODE_OPTIONS=--openssl-legacy-provider npm run build:browser && npm run build:docs",
"build:browser": "webpack --config=config/webpack.config.js",
"build:docs": "npm run build:docs:html && npm run build:docs:markdown",
"build:docs:html": "documentation build index.js -f html -o docs --config documentation.yml",
Expand Down
3 changes: 3 additions & 0 deletions test/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
'use strict';

require('../circuit-shutdown-test.js');
require('../closed-test.js');
require('../common.js');
require('../context-test.js');
require('../enable-disable-test.js');
require('../error-filter-test.js');
require('../half-open-test.js');
require('../health-check-test.js');
require('../semaphore-test.js');
require('../state-test.js');
require('../status-test.js');
require('../test.js');
require('../volume-threshold-test.js');
require('../warmup-test.js');

0 comments on commit 2017aad

Please sign in to comment.