From aaa4f4ba156243911d817eed0fdcc7bdb51e325d Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Wed, 19 Oct 2022 08:50:57 -0400 Subject: [PATCH 1/3] begin running tests in node 19.x --- .github/workflows/test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 8c93b513..462be783 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x, 18.x] # NOTE: When removing 14.x, we should be able to remove the 'upgrade npm' step!!! + node-version: [14.x, 16.x, 18.x, 19.x] # NOTE: When removing 14.x, we should be able to remove the 'upgrade npm' step!!! os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v1 From c88274da94afb0f7ecae20a5c9b639c4f59e3fce Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Wed, 19 Oct 2022 09:06:36 -0400 Subject: [PATCH 2/3] update to run github tests properly --- .github/workflows/test-pr.yml | 1 - package.json | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 462be783..b4d2caae 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -31,7 +31,6 @@ jobs: run: npm ci - name: build run: npm run build --if-present - NODE_OPTIONS: --openssl-legacy-provider - name: module test run: npm run test:module - name: run all code tests diff --git a/package.json b/package.json index 04b72eb0..8a891fc6 100644 --- a/package.json +++ b/package.json @@ -72,9 +72,9 @@ "test:require": "mocha test/test-require", "test:module": "npm run test:require && npm run test:import", "test": "npm run cypress:run && npx cross-env NODE_ENV=test BUILD_ENV=development ts-mocha -p test/tsconfig.json src/**/test/node/*.spec.* src/**/test/*.spec.* test/integration/integration.spec.ts", - "build:dev": "npx cross-env NODE_ENV=development BUILD_ENV=development webpack --config configs/webpack.config.js", - "build:prod": "npx cross-env NODE_ENV=production BUILD_ENV=production webpack --config configs/webpack.config.min.js", - "build:node": "npx cross-env NODE_ENV=production BABEL_ENV=commonjs BUILD_ENV=node webpack --config configs/webpack.node.config.js", + "build:dev": "npx cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development BUILD_ENV=development webpack --config configs/webpack.config.js", + "build:prod": "npx cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production BUILD_ENV=production webpack --config configs/webpack.config.min.js", + "build:node": "npx cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production BABEL_ENV=commonjs BUILD_ENV=node webpack --config configs/webpack.node.config.js", "build": "npm run check-types && npm run build:dev && npm run build:prod && npm run build:node", "watch": "npx cross-env BUILD_ENV=development webpack --watch", "lint": "eslint src", From 6af572b4ccbc998341670b24f6ae029f05870461 Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Wed, 19 Oct 2022 09:18:15 -0400 Subject: [PATCH 3/3] update build/test steps to split for node 17+ and node 16- --- .github/workflows/test-pr-legacy.yml | 44 ++++++++++++++++++++++++++++ .github/workflows/test-pr.yml | 23 ++++++++------- package.json | 6 ++-- 3 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test-pr-legacy.yml diff --git a/.github/workflows/test-pr-legacy.yml b/.github/workflows/test-pr-legacy.yml new file mode 100644 index 00000000..7dc7647e --- /dev/null +++ b/.github/workflows/test-pr-legacy.yml @@ -0,0 +1,44 @@ +name: Test Pull Requests To Master (Node pre-17) + +on: + push: + branches: + - greenkeeper/* + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x, 16.x] # NOTE: When removing 14.x, we should be able to remove the 'upgrade npm' step!!! + os: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: upgrade npm + run: npm install -g npm + - name: npm versions + run: | + node --version + npm --version + - name: ci install + run: npm ci + - name: build + run: npm run build --if-present + - name: module test + run: npm run test:module + - name: run all code tests + run: npm test + - name: test package import + run: | + npm install ts-node @std/esm + npm run test:import + - name: test package require + run: | + npm run test:require diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index b4d2caae..12b5b34b 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -1,4 +1,4 @@ -name: Test Pull Requests To Master +name: Test Pull Requests To Master (Node 17.0+) on: push: @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x, 18.x, 19.x] # NOTE: When removing 14.x, we should be able to remove the 'upgrade npm' step!!! + node-version: [18.x, 19.x] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v1 @@ -21,8 +21,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: upgrade npm - run: npm install -g npm - name: npm versions run: | node --version @@ -31,14 +29,17 @@ jobs: run: npm ci - name: build run: npm run build --if-present + env: + CI: true + NODE_OPTIONS: --openssl-legacy-provider # necessary for webpack v4 in node 17+ - name: module test run: npm run test:module - name: run all code tests run: npm test - # - name: test package import - # run: | - # npm install ts-node @std/esm - # npm run test:import - # - name: test package require - # run: | - # npm run test:require + - name: test package import + run: | + npm install ts-node @std/esm + npm run test:import + - name: test package require + run: | + npm run test:require diff --git a/package.json b/package.json index 8a891fc6..04b72eb0 100644 --- a/package.json +++ b/package.json @@ -72,9 +72,9 @@ "test:require": "mocha test/test-require", "test:module": "npm run test:require && npm run test:import", "test": "npm run cypress:run && npx cross-env NODE_ENV=test BUILD_ENV=development ts-mocha -p test/tsconfig.json src/**/test/node/*.spec.* src/**/test/*.spec.* test/integration/integration.spec.ts", - "build:dev": "npx cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development BUILD_ENV=development webpack --config configs/webpack.config.js", - "build:prod": "npx cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production BUILD_ENV=production webpack --config configs/webpack.config.min.js", - "build:node": "npx cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production BABEL_ENV=commonjs BUILD_ENV=node webpack --config configs/webpack.node.config.js", + "build:dev": "npx cross-env NODE_ENV=development BUILD_ENV=development webpack --config configs/webpack.config.js", + "build:prod": "npx cross-env NODE_ENV=production BUILD_ENV=production webpack --config configs/webpack.config.min.js", + "build:node": "npx cross-env NODE_ENV=production BABEL_ENV=commonjs BUILD_ENV=node webpack --config configs/webpack.node.config.js", "build": "npm run check-types && npm run build:dev && npm run build:prod && npm run build:node", "watch": "npx cross-env BUILD_ENV=development webpack --watch", "lint": "eslint src",