From aee8b6b06c7ba49300e7d82bae1418f8091ebb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 17 May 2025 23:01:36 +0300 Subject: [PATCH 01/17] build(ci): add lint job to CI workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ace0b35..3a61240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,22 @@ on: - push jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 'lts/*' + + - name: Install dependencies + run: npm install --ignore-scripts --include=dev + + - name: Run lint + run: node --run lint # Use `node --run` to run the script in package.json + test: runs-on: ubuntu-20.04 strategy: @@ -171,10 +187,6 @@ jobs: npm test fi - - name: Lint code - if: steps.list_env.outputs.eslint != '' - run: npm run lint - - name: Collect code coverage if: steps.list_env.outputs.nyc != '' run: | From 72cf48667ff2b8a6301f3789969eadfb663f437c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 18 May 2025 01:47:57 +0300 Subject: [PATCH 02/17] build(ci): update coverage job to include permissions and use specific action versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a61240..1e90782 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,24 +207,28 @@ jobs: coverage: needs: test runs-on: ubuntu-latest + permissions: + contents: read + checks: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Install lcov - shell: bash - run: sudo apt-get -y install lcov + - name: Install lcov + shell: bash + run: sudo apt-get -y install lcov - - name: Collect coverage reports - uses: actions/download-artifact@v3 - with: - name: coverage - path: ./coverage + - name: Collect coverage reports + uses: actions/download-artifact@v3 + with: + name: coverage + path: ./coverage - - name: Merge coverage reports - shell: bash - run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info + - name: Merge coverage reports + shell: bash + run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info - - name: Upload coverage report - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage report + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 + with: + file: ./coverage/lcov.info + github-token: ${{ secrets.GITHUB_TOKEN }} From 14e2be0f2cdbb1d66ef98b665d6e0ccdc7e1396b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 18 May 2025 20:33:27 +0300 Subject: [PATCH 03/17] build(ci): add iojs CI workflow to cover iojs tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/iojs.yml | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/iojs.yml diff --git a/.github/workflows/iojs.yml b/.github/workflows/iojs.yml new file mode 100644 index 0000000..3fabb37 --- /dev/null +++ b/.github/workflows/iojs.yml @@ -0,0 +1,71 @@ +name: iojs-ci + +on: + push: + branches: + - master + paths-ignore: + - '*.md' + pull_request: + paths-ignore: + - '*.md' + +concurrency: + group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: ["1.8", "2.5", "3.3"] + include: + - node-version: "1.8" + npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0" + - node-version: "2.5" + npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0" + - node-version: "3.3" + npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0" + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Install iojs ${{ matrix.node-version }} + shell: bash -eo pipefail -l {0} + run: | + nvm install --default ${{ matrix.node-version }} + dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" + + - name: Configure npm + run: | + npm config set loglevel error + npm config set shrinkwrap false + + - name: Install npm module(s) ${{ matrix.npm-i }} + run: npm install --save-dev ${{ matrix.npm-i }} + if: matrix.npm-i != '' + + - name: Remove non-test dependencies + run: npm rm --silent --save-dev connect-redis + + - name: Install Node.js dependencies + run: npm install + + - name: List environment + id: list_env + shell: bash + run: | + echo "node@$(node -v)" + echo "npm@$(npm -v)" + npm -s ls ||: + (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT" + + - name: Run tests + shell: bash + run: npm run test From 423ade654d0dd375479b4063aa44f2c5b081eb37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 18 May 2025 22:39:48 +0300 Subject: [PATCH 04/17] build(ci): remove unnecessary 'npm install' step from iojs CI workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - vhost package has 0 core dependency Signed-off-by: Mert Şişmanoğlu --- .github/workflows/iojs.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/iojs.yml b/.github/workflows/iojs.yml index 3fabb37..497aa64 100644 --- a/.github/workflows/iojs.yml +++ b/.github/workflows/iojs.yml @@ -51,21 +51,6 @@ jobs: run: npm install --save-dev ${{ matrix.npm-i }} if: matrix.npm-i != '' - - name: Remove non-test dependencies - run: npm rm --silent --save-dev connect-redis - - - name: Install Node.js dependencies - run: npm install - - - name: List environment - id: list_env - shell: bash - run: | - echo "node@$(node -v)" - echo "npm@$(npm -v)" - npm -s ls ||: - (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT" - - name: Run tests shell: bash run: npm run test From 7ff64c3269a0a956870cb18d32d2efca2e461808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Mon, 19 May 2025 01:09:15 +0300 Subject: [PATCH 05/17] build(ci): enhance CI workflow with concurrency and update Node.js versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update trigger on - concurrency - permissions - pinned action versions Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 112 +++++++++++++++++++++++++++++---------- 1 file changed, 83 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e90782..67fd167 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,29 @@ name: ci on: -- pull_request -- push + push: + branches: + - master + paths-ignore: + - '*.md' + pull_request: + types: + - opened + - edited # in case of base branch change + - synchronize + branches: + - "**" + paths-ignore: + - '*.md' + +# Cancel in progress workflows +# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run +concurrency: + group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +permissions: + contents: read jobs: lint: @@ -22,8 +43,9 @@ jobs: run: node --run lint # Use `node --run` to run the script in package.json test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: + fail-fast: false matrix: name: - Node.js 0.8 @@ -47,6 +69,12 @@ jobs: - Node.js 16.x - Node.js 17.x - Node.js 18.x + - Node.js 19.x + - Node.js 20.x + - Node.js 21.x + - Node.js 22.x + - Node.js 23.x + - Node.js 24.x include: - name: Node.js 0.8 @@ -75,60 +103,81 @@ jobs: npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 - name: Node.js 4.x - node-version: "4.9" + node-version: "4" npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 - name: Node.js 5.x - node-version: "5.12" + node-version: "5" npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 - name: Node.js 6.x - node-version: "6.16" + node-version: "6" npm-i: mocha@6.2.3 nyc@14.1.1 supertest@6.1.6 - name: Node.js 7.x - node-version: "7.10" + node-version: "7" npm-i: mocha@6.2.3 nyc@14.1.1 supertest@6.1.6 - name: Node.js 8.x - node-version: "8.16" - npm-i: mocha@7.2.0 + node-version: "8" + npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6 - name: Node.js 9.x - node-version: "9.11" - npm-i: mocha@7.2.0 + node-version: "9" + npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6 - name: Node.js 10.x - node-version: "10.24" - npm-i: mocha@8.4.0 + node-version: "10" + npm-i: mocha@8.4.0 supertest@6.1.6 - name: Node.js 11.x - node-version: "11.15" - npm-i: mocha@8.4.0 + node-version: "11" + npm-i: mocha@8.4.0 supertest@6.1.6 - name: Node.js 12.x - node-version: "12.22" + node-version: "12" + npm-i: "supertest@6.1.6" - name: Node.js 13.x - node-version: "13.14" + node-version: "13" + npm-i: "supertest@6.1.6" - - name: Node.js 13.x - node-version: "14.21" + - name: Node.js 14.x + node-version: "14" - name: Node.js 15.x - node-version: "15.14" + node-version: "15" + npm-i: "supertest@6.1.6" - name: Node.js 16.x - node-version: "16.19" + node-version: "16" - name: Node.js 17.x - node-version: "17.9" + node-version: "17" - name: Node.js 18.x - node-version: "18.13" + node-version: "18" + + - name: Node.js 19.x + node-version: "19" + + - name: Node.js 20.x + node-version: "20" + + - name: Node.js 21.x + node-version: "21" + + - name: Node.js 22.x + node-version: "22" + + - name: Node.js 23.x + node-version: "23" + + - name: Node.js 24.x + node-version: "24" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install Node.js ${{ matrix.node-version }} shell: bash -eo pipefail -l {0} @@ -143,7 +192,12 @@ jobs: dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" - name: Configure npm - run: npm config set shrinkwrap false + run: | + if [[ "$(npm config get package-lock)" == "true" ]]; then + npm config set package-lock false + else + npm config set shrinkwrap false + fi - name: Remove npm module(s) ${{ matrix.npm-rm }} run: npm rm --silent --save-dev ${{ matrix.npm-rm }} @@ -157,8 +211,8 @@ jobs: shell: bash run: | # eslint for linting - # - remove on Node.js < 12 - if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 12 ]]; then + # - remove on Node.js < 10 + if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ grep -E '^eslint(-|$)' | \ sort -r | \ @@ -175,7 +229,7 @@ jobs: echo "node@$(node -v)" echo "npm@$(npm -v)" npm -s ls ||: - (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT" + (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' - name: Run tests shell: bash @@ -197,7 +251,7 @@ jobs: fi - name: Upload code coverage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: steps.list_env.outputs.nyc != '' with: name: coverage From e05092a0539c8fdcf25f2cd88ff3dc67a6a488de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Tue, 20 May 2025 22:55:11 +0300 Subject: [PATCH 06/17] build(ci): update download-artifact action to version 4.3.0 for collecting coverage reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67fd167..2c3e369 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -272,7 +272,7 @@ jobs: run: sudo apt-get -y install lcov - name: Collect coverage reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: coverage path: ./coverage From 75d8337ff077124444e4c84c6eeefc36bb4b9e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Tue, 20 May 2025 23:20:48 +0300 Subject: [PATCH 07/17] build(ci): add names to test and coverage jobs for clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c3e369..c1f5c16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: run: node --run lint # Use `node --run` to run the script in package.json test: + name: Test runs-on: ubuntu-latest strategy: fail-fast: false @@ -259,6 +260,7 @@ jobs: retention-days: 1 coverage: + name: Coverage needs: test runs-on: ubuntu-latest permissions: From c912f90583fdfec0c5c1203c7b9ce38a4e4e2359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Tue, 20 May 2025 23:55:55 +0300 Subject: [PATCH 08/17] build(ci): disable credential persistence for checkout actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1f5c16..ff094d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: @@ -179,6 +181,8 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install Node.js ${{ matrix.node-version }} shell: bash -eo pipefail -l {0} @@ -268,6 +272,8 @@ jobs: checks: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install lcov shell: bash From c47e724f07ce673ecb5b7611ebd0d3d2dc23e147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 24 May 2025 22:24:23 +0300 Subject: [PATCH 09/17] Delete .github/workflows/iojs.yml --- .github/workflows/iojs.yml | 56 -------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 .github/workflows/iojs.yml diff --git a/.github/workflows/iojs.yml b/.github/workflows/iojs.yml deleted file mode 100644 index 497aa64..0000000 --- a/.github/workflows/iojs.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: iojs-ci - -on: - push: - branches: - - master - paths-ignore: - - '*.md' - pull_request: - paths-ignore: - - '*.md' - -concurrency: - group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" - cancel-in-progress: true - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - node-version: ["1.8", "2.5", "3.3"] - include: - - node-version: "1.8" - npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0" - - node-version: "2.5" - npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0" - - node-version: "3.3" - npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0" - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - - name: Install iojs ${{ matrix.node-version }} - shell: bash -eo pipefail -l {0} - run: | - nvm install --default ${{ matrix.node-version }} - dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" - - - name: Configure npm - run: | - npm config set loglevel error - npm config set shrinkwrap false - - - name: Install npm module(s) ${{ matrix.npm-i }} - run: npm install --save-dev ${{ matrix.npm-i }} - if: matrix.npm-i != '' - - - name: Run tests - shell: bash - run: npm run test From e72482917ce758d23242f68be49d85aea4e10360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 6 Jun 2025 14:05:21 +0300 Subject: [PATCH 10/17] fix(ci): redundant 'permissions' field Co-authored-by: Sebastian Beltran --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0bbc4d..0b06c04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,6 @@ concurrency: group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true -permissions: - contents: read permissions: contents: read From 866cfe7f61c1ec7491c62d011a0df2fc22be9f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 6 Jun 2025 14:06:59 +0300 Subject: [PATCH 11/17] style(ci): format ci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 373 +++++++++++++++++++-------------------- 1 file changed, 186 insertions(+), 187 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b06c04..b277fc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: - master paths-ignore: - - '*.md' + - "*.md" pull_request: types: - opened @@ -14,7 +14,7 @@ on: branches: - "**" paths-ignore: - - '*.md' + - "*.md" # Cancel in progress workflows # in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run @@ -22,7 +22,6 @@ concurrency: group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true - permissions: contents: read @@ -37,7 +36,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 'lts/*' + node-version: "lts/*" - name: Install dependencies run: npm install --ignore-scripts --include=dev @@ -52,223 +51,223 @@ jobs: fail-fast: false matrix: name: - - Node.js 0.8 - - Node.js 0.10 - - Node.js 0.12 - - io.js 1.x - - io.js 2.x - - io.js 3.x - - Node.js 4.x - - Node.js 5.x - - Node.js 6.x - - Node.js 7.x - - Node.js 8.x - - Node.js 9.x - - Node.js 10.x - - Node.js 11.x - - Node.js 12.x - - Node.js 13.x - - Node.js 14.x - - Node.js 15.x - - Node.js 16.x - - Node.js 17.x - - Node.js 18.x - - Node.js 19.x - - Node.js 20.x - - Node.js 21.x - - Node.js 22.x - - Node.js 23.x - - Node.js 24.x + - Node.js 0.8 + - Node.js 0.10 + - Node.js 0.12 + - io.js 1.x + - io.js 2.x + - io.js 3.x + - Node.js 4.x + - Node.js 5.x + - Node.js 6.x + - Node.js 7.x + - Node.js 8.x + - Node.js 9.x + - Node.js 10.x + - Node.js 11.x + - Node.js 12.x + - Node.js 13.x + - Node.js 14.x + - Node.js 15.x + - Node.js 16.x + - Node.js 17.x + - Node.js 18.x + - Node.js 19.x + - Node.js 20.x + - Node.js 21.x + - Node.js 22.x + - Node.js 23.x + - Node.js 24.x include: - - name: Node.js 0.8 - node-version: "0.8" - npm-i: mocha@2.5.3 supertest@1.1.0 - npm-rm: nyc + - name: Node.js 0.8 + node-version: "0.8" + npm-i: mocha@2.5.3 supertest@1.1.0 + npm-rm: nyc - - name: Node.js 0.10 - node-version: "0.10" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 + - name: Node.js 0.10 + node-version: "0.10" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 - - name: Node.js 0.12 - node-version: "0.12" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 + - name: Node.js 0.12 + node-version: "0.12" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 - - name: io.js 1.x - node-version: "1.8" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 + - name: io.js 1.x + node-version: "1.8" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 - - name: io.js 2.x - node-version: "2.5" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 + - name: io.js 2.x + node-version: "2.5" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 - - name: io.js 3.x - node-version: "3.3" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 + - name: io.js 3.x + node-version: "3.3" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0 - - name: Node.js 4.x - node-version: "4" - npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 + - name: Node.js 4.x + node-version: "4" + npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 - - name: Node.js 5.x - node-version: "5" - npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 + - name: Node.js 5.x + node-version: "5" + npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 - - name: Node.js 6.x - node-version: "6" - npm-i: mocha@6.2.3 nyc@14.1.1 supertest@6.1.6 + - name: Node.js 6.x + node-version: "6" + npm-i: mocha@6.2.3 nyc@14.1.1 supertest@6.1.6 - - name: Node.js 7.x - node-version: "7" - npm-i: mocha@6.2.3 nyc@14.1.1 supertest@6.1.6 + - name: Node.js 7.x + node-version: "7" + npm-i: mocha@6.2.3 nyc@14.1.1 supertest@6.1.6 - - name: Node.js 8.x - node-version: "8" - npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6 + - name: Node.js 8.x + node-version: "8" + npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6 - - name: Node.js 9.x - node-version: "9" - npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6 + - name: Node.js 9.x + node-version: "9" + npm-i: mocha@7.2.0 nyc@14.1.1 supertest@6.1.6 - - name: Node.js 10.x - node-version: "10" - npm-i: mocha@8.4.0 supertest@6.1.6 + - name: Node.js 10.x + node-version: "10" + npm-i: mocha@8.4.0 supertest@6.1.6 - - name: Node.js 11.x - node-version: "11" - npm-i: mocha@8.4.0 supertest@6.1.6 + - name: Node.js 11.x + node-version: "11" + npm-i: mocha@8.4.0 supertest@6.1.6 - - name: Node.js 12.x - node-version: "12" - npm-i: "supertest@6.1.6" + - name: Node.js 12.x + node-version: "12" + npm-i: "supertest@6.1.6" - - name: Node.js 13.x - node-version: "13" - npm-i: "supertest@6.1.6" + - name: Node.js 13.x + node-version: "13" + npm-i: "supertest@6.1.6" - - name: Node.js 14.x - node-version: "14" + - name: Node.js 14.x + node-version: "14" - - name: Node.js 15.x - node-version: "15" - npm-i: "supertest@6.1.6" + - name: Node.js 15.x + node-version: "15" + npm-i: "supertest@6.1.6" - - name: Node.js 16.x - node-version: "16" + - name: Node.js 16.x + node-version: "16" - - name: Node.js 17.x - node-version: "17" + - name: Node.js 17.x + node-version: "17" - - name: Node.js 18.x - node-version: "18" + - name: Node.js 18.x + node-version: "18" - - name: Node.js 19.x - node-version: "19" + - name: Node.js 19.x + node-version: "19" - - name: Node.js 20.x - node-version: "20" + - name: Node.js 20.x + node-version: "20" - - name: Node.js 21.x - node-version: "21" + - name: Node.js 21.x + node-version: "21" - - name: Node.js 22.x - node-version: "22" + - name: Node.js 22.x + node-version: "22" - - name: Node.js 23.x - node-version: "23" + - name: Node.js 23.x + node-version: "23" - - name: Node.js 24.x - node-version: "24" + - name: Node.js 24.x + node-version: "24" steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - - name: Install Node.js ${{ matrix.node-version }} - shell: bash -eo pipefail -l {0} - run: | - nvm install --default ${{ matrix.node-version }} - if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then - nvm install --alias=npm 0.10 - nvm use ${{ matrix.node-version }} - sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" - npm config set strict-ssl false - fi - dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" - - - name: Configure npm - run: | - if [[ "$(npm config get package-lock)" == "true" ]]; then - npm config set package-lock false - else - npm config set shrinkwrap false - fi - - - name: Remove npm module(s) ${{ matrix.npm-rm }} - run: npm rm --silent --save-dev ${{ matrix.npm-rm }} - if: matrix.npm-rm != '' - - - name: Install npm module(s) ${{ matrix.npm-i }} - run: npm install --save-dev ${{ matrix.npm-i }} - if: matrix.npm-i != '' - - - name: Setup Node.js version-specific dependencies - shell: bash - run: | - # eslint for linting - # - remove on Node.js < 10 - if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then - node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ - grep -E '^eslint(-|$)' | \ - sort -r | \ - xargs -n1 npm rm --silent --save-dev - fi - - - name: Install Node.js dependencies - run: npm install - - - name: List environment - id: list_env - shell: bash - run: | - echo "node@$(node -v)" - echo "npm@$(npm -v)" - npm -s ls ||: - (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' - - - name: Run tests - shell: bash - run: | - if npm -ps ls nyc | grep -q nyc; then - npm run test-ci - cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov" - else - npm test - fi - - - name: Collect code coverage - if: steps.list_env.outputs.nyc != '' - run: | - if [[ -d ./coverage ]]; then - mv ./coverage "./${{ matrix.name }}" - mkdir ./coverage - mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}" - fi - - - name: Upload code coverage - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: steps.list_env.outputs.nyc != '' - with: - name: coverage - path: ./coverage - retention-days: 1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Install Node.js ${{ matrix.node-version }} + shell: bash -eo pipefail -l {0} + run: | + nvm install --default ${{ matrix.node-version }} + if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then + nvm install --alias=npm 0.10 + nvm use ${{ matrix.node-version }} + sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" + npm config set strict-ssl false + fi + dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" + + - name: Configure npm + run: | + if [[ "$(npm config get package-lock)" == "true" ]]; then + npm config set package-lock false + else + npm config set shrinkwrap false + fi + + - name: Remove npm module(s) ${{ matrix.npm-rm }} + run: npm rm --silent --save-dev ${{ matrix.npm-rm }} + if: matrix.npm-rm != '' + + - name: Install npm module(s) ${{ matrix.npm-i }} + run: npm install --save-dev ${{ matrix.npm-i }} + if: matrix.npm-i != '' + + - name: Setup Node.js version-specific dependencies + shell: bash + run: | + # eslint for linting + # - remove on Node.js < 10 + if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then + node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ + grep -E '^eslint(-|$)' | \ + sort -r | \ + xargs -n1 npm rm --silent --save-dev + fi + + - name: Install Node.js dependencies + run: npm install + + - name: List environment + id: list_env + shell: bash + run: | + echo "node@$(node -v)" + echo "npm@$(npm -v)" + npm -s ls ||: + (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }' + + - name: Run tests + shell: bash + run: | + if npm -ps ls nyc | grep -q nyc; then + npm run test-ci + cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov" + else + npm test + fi + + - name: Collect code coverage + if: steps.list_env.outputs.nyc != '' + run: | + if [[ -d ./coverage ]]; then + mv ./coverage "./${{ matrix.name }}" + mkdir ./coverage + mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}" + fi + + - name: Upload code coverage + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: steps.list_env.outputs.nyc != '' + with: + name: coverage + path: ./coverage + retention-days: 1 coverage: name: Coverage permissions: - checks: write # for coverallsapp/github-action to create new checks - contents: read # for actions/checkout to fetch code + checks: write # for coverallsapp/github-action to create new checks + contents: read # for actions/checkout to fetch code needs: test runs-on: ubuntu-latest steps: From 0568f2632e0c66e84a302b9d17a4d0d8063e5921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 6 Jun 2025 14:24:43 +0300 Subject: [PATCH 12/17] fix(ci): avoid coverage artifact conflicts and enable merging of multiple reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b277fc4..25a67df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,7 +259,7 @@ jobs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: steps.list_env.outputs.nyc != '' with: - name: coverage + name: coverage-${{ strategy.job-index }} # to avoid conflicts path: ./coverage retention-days: 1 @@ -282,8 +282,9 @@ jobs: - name: Collect coverage reports uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - name: coverage + pattern: coverage-* # download all coverage artifacts path: ./coverage + merge-multiple: true - name: Merge coverage reports shell: bash From 5306ea796a24f4a5aa2836fef413159c482a5835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 6 Jun 2025 16:11:30 +0300 Subject: [PATCH 13/17] fix(ci): remove multiple artifact merge step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25a67df..effa3bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -286,10 +286,6 @@ jobs: path: ./coverage merge-multiple: true - - name: Merge coverage reports - shell: bash - run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info - - name: Upload coverage report uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 with: From 37b35a327b0aace7506df87b1e684299bb2a238f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 21 Jun 2025 19:16:58 +0300 Subject: [PATCH 14/17] fix(ci): add 'Merge coverage reports' step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index effa3bb..a7ea714 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -284,7 +284,10 @@ jobs: with: pattern: coverage-* # download all coverage artifacts path: ./coverage - merge-multiple: true + + - name: Merge coverage reports + shell: bash + run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info - name: Upload coverage report uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 From b79cf042ce7819171c4eee5fcf19fbc68db4e627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 21 Jun 2025 19:19:01 +0300 Subject: [PATCH 15/17] feat(ci): enable manual triggering of workflows with workflow_dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7ea714..20eefe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ on: - "**" paths-ignore: - "*.md" + workflow_dispatch: # Cancel in progress workflows # in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run From 521e19fbdd73bb1dde9fd193c607e95b711f5979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 12 Jul 2025 09:46:17 +0300 Subject: [PATCH 16/17] fix(ci): update coverage report paths to use node version instead of name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mert Şişmanoğlu --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20eefe9..9718a96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -242,7 +242,7 @@ jobs: run: | if npm -ps ls nyc | grep -q nyc; then npm run test-ci - cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov" + cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov" else npm test fi @@ -251,17 +251,17 @@ jobs: if: steps.list_env.outputs.nyc != '' run: | if [[ -d ./coverage ]]; then - mv ./coverage "./${{ matrix.name }}" + mv ./coverage "./${{ matrix.node-version }}" mkdir ./coverage - mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}" + mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}" fi - name: Upload code coverage uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: steps.list_env.outputs.nyc != '' with: - name: coverage-${{ strategy.job-index }} # to avoid conflicts - path: ./coverage + name: coverage-${{ matrix.node-version }} # to avoid conflicts + path: "./coverage/${{ matrix.node-version }}" retention-days: 1 coverage: @@ -283,7 +283,6 @@ jobs: - name: Collect coverage reports uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - pattern: coverage-* # download all coverage artifacts path: ./coverage - name: Merge coverage reports From 9b581edd15a552664b735890ffbb421459865ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 12 Jul 2025 09:47:52 +0300 Subject: [PATCH 17/17] fix(ci): remove pull request types Co-authored-by: Sebastian Beltran --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9718a96..2adf455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,6 @@ on: paths-ignore: - "*.md" pull_request: - types: - - opened - - edited # in case of base branch change - - synchronize branches: - "**" paths-ignore: