From a4c383f6e8bbd25aa4a34c2d2a9a510b56118e0e Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Fri, 27 Mar 2026 10:18:26 +0100 Subject: [PATCH 1/8] perf(workflow): parallelise jobs --- .github/workflows/npmpublish.yml | 20 ++--- .github/workflows/run-tests-windows.yml | 27 ++---- .github/workflows/run-tests.yml | 113 ++++++++++++++---------- 3 files changed, 81 insertions(+), 79 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 3cf4198c..265f122f 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -1,6 +1,3 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages - name: SASjs CLI Deploy on: @@ -8,22 +5,21 @@ on: branches: - main +env: + NODE_VERSION: lts/iron + jobs: release: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [lts/iron] - steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Use Node.js + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} cache: npm - name: Install dependencies @@ -43,7 +39,7 @@ jobs: - name: Semantic Release uses: cycjimmy/semantic-release-action@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} cache: npm env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-tests-windows.yml b/.github/workflows/run-tests-windows.yml index 158dba3f..64f0b743 100644 --- a/.github/workflows/run-tests-windows.yml +++ b/.github/workflows/run-tests-windows.yml @@ -1,35 +1,28 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - name: Run mocked tests on Windows on: pull_request: +env: + NODE_VERSION: lts/iron + jobs: test: runs-on: windows-latest - strategy: - matrix: - node-version: [lts/iron] - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Use Node.js + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} cache: npm - uses: ssciwr/doxygen-install@v1 with: version: '1.9.3' - - name: Check doxygen version - run: doxygen -v - - name: Create .env file for sasjs/server run: | echo RUN_TIMES=js >> .env @@ -49,12 +42,6 @@ jobs: npm config set registry http://registry.npmjs.org npm ci - - name: Check code style - run: npm run lint - - - name: Install rimraf - run: npm i -g rimraf - - name: Build Project run: npm run build diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d3cb28a6..af796eae 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,97 +1,116 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - name: Node.js CI on: pull_request: +env: + NODE_VERSION: lts/iron + jobs: - test: + lint: runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [lts/iron] - steps: - - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} cache: npm + - run: npm ci + - name: Check code style + run: npm run lint + audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + - name: Install production dependencies + run: npm ci --omit=dev --ignore-scripts - name: Check npm audit run: npm audit --omit=dev --audit-level=low - - name: Install production dependencies (fail if any warning) - run: | - npm ci --omit=dev --ignore-scripts - # sh ./npm-production-install.sh - - name: Install dependencies - run: | - npm config set registry http://registry.npmjs.org - npm ci - - - name: Install Compodoc - run: npm i -g @compodoc/compodoc - - - name: Generate development documentation and test level of documentation coverage + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + - run: npm ci + - name: Generate docs and check coverage run: npm run doc - - name: Check code style - run: npm run lint - + build-and-smoke: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + - run: npm ci - name: Build Project run: npm run build - - name: Test Package Install run: | npm version "5.0.0" --no-git-tag-version npm pack npm install -g ./sasjs-cli-5.0.0.tgz sasjs v - - name: Run smoke tests run: sh ./test.sh + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + - run: npm ci - name: Install Doxygen run: sudo apt-get install -y doxygen - - # Mocked (*.spec.ts) tests will be conducted during this step - name: Generate coverage report - uses: artiomtr/jest-coverage-report-action@v2.0-rc.2 + uses: artiomtr/jest-coverage-report-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} test-script: npx jest --config=jest.config.js --silent --runInBand --ci --coverage --testLocationInResults --json --outputFile="report.json" - - name: Install PM2 - run: npm i -g pm2 - + server-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + - run: npm ci + - name: Install Doxygen + run: sudo apt-get install -y doxygen + - name: Build Project + run: npm run build - name: Create .env file for sasjs/server run: | echo "RUN_TIMES=js" >> .env echo "NODE_PATH=node" >> .env echo "MOCK_SERVERTYPE=sas9" >> .env - - name: Download sasjs/server package run: curl -L https://github.com/sasjs/server/releases/latest/download/linux.zip -o linux.zip - - - name: Unzip downloaded package - run: unzip linux.zip - - - name: Run sasjs server - run: pm2 start api-linux - + - name: Unzip and start server + run: | + unzip linux.zip + npx pm2 start api-linux - name: Deploy SAS9 tests run: | cd mocks sasjs cbd cd .. ls sasjs_root -R - - name: Run server tests run: npm run test:server env: From cce2319a27ce3052b42bacff989ae1eb9e3244fd Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Fri, 27 Mar 2026 10:31:02 +0100 Subject: [PATCH 2/8] perf(workflow): parallelize mocked tests and fix CI job issues --- .github/workflows/run-tests.yml | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index af796eae..ebc8e569 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -41,6 +41,8 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: npm - run: npm ci + - name: Install Compodoc + run: npm i -g @compodoc/compodoc - name: Generate docs and check coverage run: npm run doc @@ -105,6 +107,11 @@ jobs: run: | unzip linux.zip npx pm2 start api-linux + - name: Install sasjs CLI globally + run: | + npm version "5.0.0" --no-git-tag-version + npm pack + npm install -g ./sasjs-cli-5.0.0.tgz - name: Deploy SAS9 tests run: | cd mocks diff --git a/package.json b/package.json index fc427ffb..eeaf065c 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "copy:doxy": "copyfiles -u 2 src/doxy/* build/doxy/", "test": "npm run test:mocked && npm run test:server", "test:server": "jest --silent --runInBand --config=jest.server.config.js", - "test:mocked": "jest --silent --runInBand --config=jest.config.js --coverage", + "test:mocked": "jest --silent --config=jest.config.js --coverage", "lint:fix": "npx prettier --write \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "lint": "npx prettier --check \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true", From eef34dae549e2f34b0d9570c280b2d796ae8c38e Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Fri, 27 Mar 2026 10:55:11 +0100 Subject: [PATCH 3/8] fix(test): restore --runInBand for test:mocked --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eeaf065c..fc427ffb 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "copy:doxy": "copyfiles -u 2 src/doxy/* build/doxy/", "test": "npm run test:mocked && npm run test:server", "test:server": "jest --silent --runInBand --config=jest.server.config.js", - "test:mocked": "jest --silent --config=jest.config.js --coverage", + "test:mocked": "jest --silent --runInBand --config=jest.config.js --coverage", "lint:fix": "npx prettier --write \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "lint": "npx prettier --check \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true", From 14097392d694da99c38c1bd8c87fbdf66b996844 Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Fri, 27 Mar 2026 11:12:08 +0100 Subject: [PATCH 4/8] fix(ci): fix unit-tests job and exclude generated test app specs --- .github/workflows/run-tests.yml | 9 ++++++++- jest.config.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ebc8e569..827d907b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -77,8 +77,15 @@ jobs: - run: npm ci - name: Install Doxygen run: sudo apt-get install -y doxygen + - name: Build Project + run: npm run build + - name: Install sasjs CLI globally + run: | + npm version "5.0.0" --no-git-tag-version + npm pack + npm install -g ./sasjs-cli-5.0.0.tgz - name: Generate coverage report - uses: artiomtr/jest-coverage-report-action@v2 + uses: artiomtr/jest-coverage-report-action@v2.0-rc.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} test-script: npx jest --config=jest.config.js --silent --runInBand --ci --coverage --testLocationInResults --json --outputFile="report.json" diff --git a/jest.config.js b/jest.config.js index 3d16ffbe..0d104abe 100644 --- a/jest.config.js +++ b/jest.config.js @@ -152,7 +152,7 @@ module.exports = { testMatch: ['**/*spec.[j|t]s?(x)'], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped - testPathIgnorePatterns: ['/node_modules/', '/build/'], + testPathIgnorePatterns: ['/node_modules/', '/build/', 'test-app-create-', 'test-app-init-'], // The regexp pattern or array of patterns that Jest uses to detect test files // testRegex: [], From 471eabca4771af430b5e2fba902fa29178754849 Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Mon, 13 Apr 2026 13:41:17 +0200 Subject: [PATCH 5/8] chore(deps): bump adapter, axios, picomatch --- package-lock.json | 36 ++++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e8f52ae..fd5f173e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "@sasjs/cli", "license": "ISC", "dependencies": { - "@sasjs/adapter": "4.16.3", + "@sasjs/adapter": "^4.16.5", "@sasjs/core": "4.62.0", "@sasjs/lint": "2.4.3", "@sasjs/utils": "3.5.6", @@ -2477,13 +2477,13 @@ } }, "node_modules/@sasjs/adapter": { - "version": "4.16.3", - "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.16.3.tgz", - "integrity": "sha512-xcoZT9qZhF6pXvXx4bHxbmauLdEHng8pSlTK4F6asUkHNR5uzeSvY6znA1yJqK+8FFtsVILyvMQyGyhWw6WsOA==", + "version": "4.16.5", + "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-4.16.5.tgz", + "integrity": "sha512-aBjW6LRSZLVXI8ZvdjDe7uflXShzF2K+Ly3ts7SRjGzoYa34PrAgq03e1O4jpNy2JVc6K42xq0c/hVmwsQAu6Q==", "license": "ISC", "dependencies": { - "@sasjs/utils": "3.5.6", - "axios": "^1.13.5", + "@sasjs/utils": "^3.5.6", + "axios": "1.15.0", "axios-cookiejar-support": "5.0.5", "form-data": "4.0.4", "https": "1.0.0", @@ -3087,14 +3087,14 @@ } }, "node_modules/axios": { - "version": "1.13.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz", - "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz", + "integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.11", "form-data": "^4.0.5", - "proxy-from-env": "^1.1.0" + "proxy-from-env": "^2.1.0" } }, "node_modules/axios-cookiejar-support": { @@ -6909,9 +6909,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -7018,9 +7018,13 @@ } }, "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } }, "node_modules/psl": { "version": "1.15.0", diff --git a/package.json b/package.json index fc427ffb..3f8e843a 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "access": "public" }, "dependencies": { - "@sasjs/adapter": "4.16.3", + "@sasjs/adapter": "^4.16.5", "@sasjs/core": "4.62.0", "@sasjs/lint": "2.4.3", "@sasjs/utils": "3.5.6", From 2da697ae8a7c5a6e8f2b66b066eb7331b4ed56f0 Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Mon, 13 Apr 2026 13:44:12 +0200 Subject: [PATCH 6/8] chore: bump core --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd5f173e..7638431f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@sasjs/adapter": "^4.16.5", - "@sasjs/core": "4.62.0", + "@sasjs/core": "^4.63.0", "@sasjs/lint": "2.4.3", "@sasjs/utils": "3.5.6", "adm-zip": "0.5.10", @@ -2491,9 +2491,9 @@ } }, "node_modules/@sasjs/core": { - "version": "4.62.0", - "resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.62.0.tgz", - "integrity": "sha512-xMWeZbxlvuCP0B9fnSTgSFbSiA0hiKDpTua8wb0ghMUOl+dnh/XF+BYgrHhWhPL9j0+k5d8mJejLmf/l/txpzg==", + "version": "4.63.0", + "resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.63.0.tgz", + "integrity": "sha512-NlIihA4BbP+mveAbb7A/hgnrZEpJKKIkq0v4SSDdYXg8YYdKAdyTK8K+6FNPwp+U6hixQCKVX8oCA1DIUppLqA==", "license": "MIT" }, "node_modules/@sasjs/lint": { diff --git a/package.json b/package.json index 3f8e843a..94c63c86 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@sasjs/adapter": "^4.16.5", - "@sasjs/core": "4.62.0", + "@sasjs/core": "^4.63.0", "@sasjs/lint": "2.4.3", "@sasjs/utils": "3.5.6", "adm-zip": "0.5.10", From 01962157645dae5c777e71ec5f2e0cd139a55385 Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Tue, 14 Apr 2026 09:38:27 +0200 Subject: [PATCH 7/8] ci: matrix node versions on ubuntu jobs --- .github/workflows/run-tests.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 827d907b..ef17cb69 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -3,17 +3,17 @@ name: Node.js CI on: pull_request: -env: - NODE_VERSION: lts/iron - jobs: lint: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - name: Check code style @@ -21,11 +21,14 @@ jobs: audit: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: npm - name: Install production dependencies run: npm ci --omit=dev --ignore-scripts @@ -34,11 +37,14 @@ jobs: docs: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - name: Install Compodoc @@ -48,11 +54,14 @@ jobs: build-and-smoke: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - name: Build Project @@ -68,11 +77,14 @@ jobs: unit-tests: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - name: Install Doxygen @@ -92,11 +104,14 @@ jobs: server-tests: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - name: Install Doxygen From 499f53c5a41d1a1b83a3c51bcc094b581ea819b6 Mon Sep 17 00:00:00 2001 From: mulahasanovic Date: Wed, 6 May 2026 10:31:20 +0200 Subject: [PATCH 8/8] chore: remove lts/iron --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f81c3fb0..cd63a222 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20, 22, 24] + node-version: [22, 24] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4