From d2023b363220b1617bc5c6cb7732c6d430881b5d Mon Sep 17 00:00:00 2001 From: daffl Date: Mon, 29 Jan 2024 11:56:54 -0800 Subject: [PATCH 1/4] chore: Add Windows CI --- .github/workflows/nodejs.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index ebde63371e..1c8b8deb90 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -45,3 +45,45 @@ jobs: fi env: CODECLIMATE_REPO_TOKEN: ${{ secrets.codeclimate }} + build-windows: + runs-on: windows-latest + + strategy: + matrix: + node-version: [20.x] + + services: + postgres: + image: postgres:latest + env: + POSTGRES_DB: feathers + POSTGRES_PASSWORD: postgres + POSTGRES_PORT: 5432 + POSTGRES_USER: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm i npm -g + - run: npm install -g codeclimate-test-reporter + - run: npm install + - run: npm test + env: + CI: true + TEST_DB: postgres + - run: | + if [ "$CODECLIMATE_REPO_TOKEN" != "" ]; then + codeclimate-test-reporter < coverage/lcov.info + fi + env: + CODECLIMATE_REPO_TOKEN: ${{ secrets.codeclimate }} From 754efe39c8e52a34292a5acb6625de91bcb243c0 Mon Sep 17 00:00:00 2001 From: daffl Date: Mon, 29 Jan 2024 11:58:39 -0800 Subject: [PATCH 2/4] Windows without coverage and only on SQLite --- .github/workflows/nodejs.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 1c8b8deb90..e3fef28c33 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -52,22 +52,6 @@ jobs: matrix: node-version: [20.x] - services: - postgres: - image: postgres:latest - env: - POSTGRES_DB: feathers - POSTGRES_PASSWORD: postgres - POSTGRES_PORT: 5432 - POSTGRES_USER: postgres - ports: - - 5432:5432 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} @@ -80,10 +64,3 @@ jobs: - run: npm test env: CI: true - TEST_DB: postgres - - run: | - if [ "$CODECLIMATE_REPO_TOKEN" != "" ]; then - codeclimate-test-reporter < coverage/lcov.info - fi - env: - CODECLIMATE_REPO_TOKEN: ${{ secrets.codeclimate }} From e9d5fffc056e9952a37b0e2c3fc04f3cc7f7c7e2 Mon Sep 17 00:00:00 2001 From: daffl Date: Mon, 29 Jan 2024 12:06:16 -0800 Subject: [PATCH 3/4] Use SHX for echo --- packages/tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tests/package.json b/packages/tests/package.json index 46953fddc5..0f05e86ec2 100644 --- a/packages/tests/package.json +++ b/packages/tests/package.json @@ -34,7 +34,7 @@ "scripts": { "prepublish": "npm run compile", "pack": "echo \"not necessary\"", - "test": "echo \"not necessary\"", + "test": "shx echo \"not necessary\"", "compile": "shx rm -rf lib/ && tsc" }, "directories": { From bea1f002bd7e149996165bc5d4257d8cca0cc287 Mon Sep 17 00:00:00 2001 From: daffl Date: Mon, 29 Jan 2024 12:19:50 -0800 Subject: [PATCH 4/4] Use cross-env --- package-lock.json | 19 +++++++++++++++++++ packages/configuration/package.json | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 606ce5ce83..5eebe7179d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8749,6 +8749,24 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -24230,6 +24248,7 @@ "devDependencies": { "@types/mocha": "^10.0.6", "@types/node": "^20.11.6", + "cross-env": "^7.0.3", "mocha": "^10.2.0", "shx": "^0.3.4", "ts-node": "^10.9.2", diff --git a/packages/configuration/package.json b/packages/configuration/package.json index e68fd8f17d..f03320c268 100644 --- a/packages/configuration/package.json +++ b/packages/configuration/package.json @@ -44,7 +44,7 @@ "prepublish": "npm run compile", "pack": "npm pack --pack-destination ../generators/test/build", "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "NODE_CONFIG_DIR=./test/config mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" + "test": "cross-env NODE_CONFIG_DIR=./test/config mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" }, "semistandard": { "env": [ @@ -67,6 +67,7 @@ "devDependencies": { "@types/mocha": "^10.0.6", "@types/node": "^20.11.6", + "cross-env": "^7.0.3", "mocha": "^10.2.0", "shx": "^0.3.4", "ts-node": "^10.9.2",