From 3300c30a9e89771e83987db2a13dc65b91b0de52 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 18:15:21 -0500 Subject: [PATCH 01/12] improve ci workflow --- .github/workflows/ci.yml | 120 ++++++++++++++++++++++++++------------- README.md | 3 - appveyor.yml | 92 ------------------------------ package.json | 2 +- 4 files changed, 82 insertions(+), 135 deletions(-) delete mode 100644 appveyor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41c776cc..5c5644a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,43 @@ name: ci on: -- pull_request -- push + push: + branches: + - master + paths-ignore: + - '*.md' + pull_request: + 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 jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + + - name: Install dependencies + run: npm install --ignore-scripts --only=dev + + - name: Run lint + run: npm run lint + test: - runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: + os: [ubuntu-latest, windows-latest] name: - Node.js 0.8 - Node.js 0.10 @@ -35,6 +64,7 @@ jobs: - Node.js 20.x - Node.js 21.x - Node.js 22.x + - Node.js 23.x include: - name: Node.js 0.8 @@ -107,51 +137,48 @@ jobs: npm-i: supertest@6.1.3 - name: Node.js 15.x - node-version: "15.14" + node-version: "15" npm-i: supertest@6.1.3 - name: Node.js 16.x - node-version: "16.20" + node-version: "16" npm-i: supertest@6.1.3 - name: Node.js 17.x - node-version: "17.9" + node-version: "17" npm-i: supertest@6.1.3 - name: Node.js 18.x - node-version: "18.18" + node-version: "18" - name: Node.js 19.x - node-version: "19.9" + node-version: "19" - name: Node.js 20.x - node-version: "20.9" + node-version: "20" - name: Node.js 21.x - node-version: "21.1" + node-version: "21" - name: Node.js 22.x - node-version: "22.0" + node-version: "22" + - name: Node.js 23.x + node-version: "23" + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + 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 }} - if [[ "$(npm -v)" == 1.1.* ]]; then - nvm exec npm npm install -g npm@1.1 - ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm" - else - sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" - fi - npm config set strict-ssl false - fi - dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Npm version fixes + if: ${{matrix.npm-version != ''}} + run: npm install -g ${{ matrix.npm-version }} - name: Configure npm run: | @@ -202,24 +229,39 @@ jobs: npm test fi - - name: Lint code - if: steps.list_env.outputs.eslint != '' - run: npm run lint - - - name: Collect code coverage - uses: coverallsapp/github-action@master + - name: Upload code coverage if: steps.list_env.outputs.nyc != '' + uses: actions/upload-artifact@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - flag-name: run-${{ matrix.test_number }} - parallel: true + name: coverage-node-${{ matrix.node-version }} + path: ./coverage/lcov.info + retention-days: 1 coverage: needs: test runs-on: ubuntu-latest + permissions: + contents: read + checks: write steps: - - name: Upload code coverage - uses: coverallsapp/github-action@master + - uses: actions/checkout@v4 + + - name: Install lcov + shell: bash + run: sudo apt-get -y install lcov + + - name: Collect coverage reports + uses: actions/download-artifact@v4 + with: + path: ./coverage + pattern: coverage-node-* + + - name: Merge coverage reports + shell: bash + run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info + + - name: Upload coverage report + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true \ No newline at end of file + file: ./lcov.info \ No newline at end of file diff --git a/README.md b/README.md index f720b0d9..d77dc94c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Linux Build Status][ci-image]][ci-url] -[![Windows Build][appveyor-image]][appveyor-url] [![Coverage Status][coveralls-image]][coveralls-url] Serves pages that contain directory listings for a given path. @@ -139,8 +138,6 @@ app.listen(3000) [MIT](LICENSE). The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons are created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/). -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-index/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-index [ci-image]: https://badgen.net/github/checks/expressjs/serve-index/master?label=ci [ci-url]: https://github.com/expressjs/serve-index/actions/workflows/ci.yml [coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-index/master.svg diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a6d60ff0..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,92 +0,0 @@ -environment: - matrix: - - nodejs_version: "0.8" - - nodejs_version: "0.10" - - nodejs_version: "0.12" - - nodejs_version: "1.8" - - nodejs_version: "2.5" - - nodejs_version: "3.3" - - nodejs_version: "4.9" - - nodejs_version: "5.12" - - nodejs_version: "6.17" - - nodejs_version: "7.10" - - nodejs_version: "8.17" - - nodejs_version: "9.11" - - nodejs_version: "10.24" - - nodejs_version: "11.15" - - nodejs_version: "12.22" - - nodejs_version: "13.14" - - nodejs_version: "14.16" - - nodejs_version: "15.13" -cache: - - node_modules -install: - # Install Node.js - - ps: >- - try { Install-Product node $env:nodejs_version -ErrorAction Stop } - catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) } - # Configure npm - - ps: | - # Skip updating shrinkwrap / lock - npm config set shrinkwrap false - # Skip SSL validation on Node.js < 0.10 - if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) { - npm config set strict-ssl false - } - # Remove all non-test dependencies - - ps: | - # Remove coverage dependency - npm rm --silent --save-dev nyc - # Remove lint dependencies - cmd.exe /c "node -pe `"Object.keys(require('./package').devDependencies).join('\n')`"" | ` - sls "^eslint(-|$)" | ` - %{ npm rm --silent --save-dev $_ } - # Setup Node.js version-specific dependencies - - ps: | - # mocha for testing - # - use 2.x for Node.js < 0.10 - # - use 3.x for Node.js < 4 - # - use 5.x for Node.js < 6 - # - use 6.x for Node.js < 8 - # - use 7.x for Node.js < 10 - if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) { - npm install --silent --save-dev mocha@2.5.3 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) { - npm install --silent --save-dev mocha@3.5.3 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) { - npm install --silent --save-dev mocha@5.2.0 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 8) { - npm install --silent --save-dev mocha@6.2.2 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 10) { - npm install --silent --save-dev mocha@7.2.0 - } - - ps: | - # mocha for testing - # - use 1.1.0 for Node.js < 0.10 - # - use 2.0.0 for Node.js < 4 - # - use 3.4.2 for Node.js < 6 - if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) { - npm install --silent --save-dev supertest@1.1.0 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) { - npm install --silent --save-dev supertest@2.0.0 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) { - npm install --silent --save-dev supertest@3.4.2 - } - # Update Node.js modules - - ps: | - # Prune & rebuild node_modules - if (Test-Path -Path node_modules) { - npm prune - npm rebuild - } - # Install Node.js modules - - npm install -build: off -test_script: - # Output version data - - ps: | - node --version - npm --version - # Run test script - - npm test -version: "{build}" diff --git a/package.json b/package.json index c7f520e1..82f9c878 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "scripts": { "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", + "test": "mocha --reporter spec --check-leaks test/", "test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test" } From 38888990edff80b912455f6b9b460cfe201d1543 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 18:20:08 -0500 Subject: [PATCH 02/12] fix --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c5644a3..47b2a822 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,11 +182,7 @@ jobs: - 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 + npm config set package-lock false - name: Remove npm module(s) ${{ matrix.npm-rm }} if: matrix.npm-rm != '' From 19e872022ddb64dd88d2bce78f9b7cf3b758b545 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 18:35:19 -0500 Subject: [PATCH 03/12] remove io.js --- .github/workflows/ci.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47b2a822..951ec58e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,18 +80,6 @@ jobs: node-version: "0.12" npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 - - name: io.js 1.x - node-version: "1.8" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 - - - name: io.js 2.x - node-version: "2.5" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 - - - name: io.js 3.x - node-version: "3.3" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 - - name: Node.js 4.x node-version: "4.9" npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 From 651fbff9628bb031bcad18b914cf1b6221995237 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 18:45:06 -0500 Subject: [PATCH 04/12] fix coverage --- .github/workflows/ci.yml | 44 +++++++++++++--------------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 951ec58e..bf20145d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,9 +42,6 @@ jobs: - 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 @@ -164,12 +161,18 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name OpenSSL npm + run: npm install -g npm@latest + - name: Npm version fixes if: ${{matrix.npm-version != ''}} run: npm install -g ${{ matrix.npm-version }} - name: Configure npm run: | + if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then + npm config set strict-ssl false + fi npm config set package-lock false - name: Remove npm module(s) ${{ matrix.npm-rm }} @@ -213,39 +216,20 @@ jobs: npm test fi - - name: Upload code coverage + - name: Collect code coverage + uses: coverallsapp/github-action@master if: steps.list_env.outputs.nyc != '' - uses: actions/upload-artifact@v4 with: - name: coverage-node-${{ matrix.node-version }} - path: ./coverage/lcov.info - retention-days: 1 + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.test_number }} + parallel: true coverage: needs: test runs-on: ubuntu-latest - permissions: - contents: read - checks: write steps: - - uses: actions/checkout@v4 - - - name: Install lcov - shell: bash - run: sudo apt-get -y install lcov - - - name: Collect coverage reports - uses: actions/download-artifact@v4 - with: - path: ./coverage - pattern: coverage-node-* - - - name: Merge coverage reports - shell: bash - run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info - - - name: Upload coverage report - uses: coverallsapp/github-action@v2 + - name: Upload code coverage + uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - file: ./lcov.info \ No newline at end of file + parallel-finished: true \ No newline at end of file From fd16b711d8405b64dafc0dfb302302237b9a5620 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 18:47:08 -0500 Subject: [PATCH 05/12] openssl npm --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf20145d..d89152ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,14 +161,12 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name OpenSSL npm - run: npm install -g npm@latest - - name: Npm version fixes if: ${{matrix.npm-version != ''}} run: npm install -g ${{ matrix.npm-version }} - name: Configure npm + shell: bash -eo pipefail -l {0} run: | if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then npm config set strict-ssl false From 9ad5ad08114cf614c0edd7babab0c21f6e7775b7 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 19:20:55 -0500 Subject: [PATCH 06/12] add io.js --- .github/workflows/ci.yml | 3 ++ .github/workflows/iojs.yml | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/iojs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d89152ec..7b4af1ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,10 +72,12 @@ jobs: - name: Node.js 0.10 node-version: "0.10" npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 + npm-version: "npm@2.15.1" - name: Node.js 0.12 node-version: "0.12" npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 + npm-version: "npm@2.15.1" - name: Node.js 4.x node-version: "4.9" @@ -84,6 +86,7 @@ jobs: - name: Node.js 5.x node-version: "5.12" npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 + npm-version: npm@3.10.10 - name: Node.js 6.x node-version: "6.17" diff --git a/.github/workflows/iojs.yml b/.github/workflows/iojs.yml new file mode 100644 index 00000000..fba0a201 --- /dev/null +++ b/.github/workflows/iojs.yml @@ -0,0 +1,67 @@ +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 + +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@v4 + + - 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 e0c187d5d8acb8fb5081f240dac953723cddb5f1 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 19:41:52 -0500 Subject: [PATCH 07/12] ubuntu --- .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 7b4af1ef..db939778 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-20.04, windows-latest] name: - Node.js 0.8 - Node.js 0.10 From 74823449fded907d3c6b76e6aff049c0a9982c51 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 20:26:47 -0500 Subject: [PATCH 08/12] fix node 0.8 --- .github/workflows/ci.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db939778..ffb06f0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,20 +160,36 @@ jobs: persist-credentials: false - name: Setup Node.js ${{ matrix.node-version }} + if: ${{ matrix.node-version != '0.8' }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + - name: Setup Node.js 0.8 + if: ${{ matrix.node-version == '0.8' && matrix.os == 'ubuntu-20.04' }} + shell: bash -eo pipefail -l {0} + run: | + nvm install --default ${{ matrix.node-version }} + nvm install --alias=npm 0.10 + nvm use ${{ matrix.node-version }} + if [[ "$(npm -v)" == 1.1.* ]]; then + nvm exec npm npm install -g npm@1.1 + ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm" + else + sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" + fi + npm config set strict-ssl false + dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" + - name: Npm version fixes if: ${{matrix.npm-version != ''}} - run: npm install -g ${{ matrix.npm-version }} + shell: bash -eo pipefail -l {0} + run: | + npm install -g ${{ matrix.npm-version }} - name: Configure npm shell: bash -eo pipefail -l {0} run: | - if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then - npm config set strict-ssl false - fi npm config set package-lock false - name: Remove npm module(s) ${{ matrix.npm-rm }} From d700770a2868de2ed322f0707d41deb38e8b3366 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 1 Feb 2025 20:28:31 -0500 Subject: [PATCH 09/12] ubuntu latest --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffb06f0e..a15523a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-latest, windows-latest] name: - Node.js 0.8 - Node.js 0.10 @@ -166,7 +166,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Setup Node.js 0.8 - if: ${{ matrix.node-version == '0.8' && matrix.os == 'ubuntu-20.04' }} + if: ${{ matrix.node-version == '0.8' && matrix.os == 'ubuntu-latest' }} shell: bash -eo pipefail -l {0} run: | nvm install --default ${{ matrix.node-version }} From 17d1e40afe395e98e81dbc277dfa703cf2cd0073 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sun, 2 Feb 2025 12:45:19 -0500 Subject: [PATCH 10/12] add macos test --- .github/workflows/macos.yml | 182 ++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..3246caa5 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,182 @@ +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 + +jobs: + test: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + name: + - Node.js 0.8 + - Node.js 0.10 + - Node.js 0.12 + - 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 + 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.10 + node-version: "0.10" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 + npm-version: "npm@2.15.1" + + - name: Node.js 0.12 + node-version: "0.12" + npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 + npm-version: "npm@2.15.1" + + - name: Node.js 4.x + node-version: "4.9" + npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 + + - name: Node.js 5.x + node-version: "5.12" + npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 + npm-version: npm@3.10.10 + + - name: Node.js 6.x + node-version: "6.17" + npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.3 + + - name: Node.js 7.x + node-version: "7.10" + npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.3 + + - name: Node.js 8.x + node-version: "8.17" + npm-i: mocha@7.1.2 nyc@14.1.1 supertest@6.1.3 + + - name: Node.js 9.x + node-version: "9.11" + npm-i: mocha@7.1.2 nyc@14.1.1 supertest@6.1.3 + + - name: Node.js 10.x + node-version: "10.24" + npm-i: mocha@8.4.0 supertest@6.1.3 + + - name: Node.js 11.x + node-version: "11.15" + npm-i: mocha@8.4.0 supertest@6.1.3 + + - name: Node.js 12.x + node-version: "12.22" + npm-i: mocha@9.2.2 supertest@6.1.3 + + - name: Node.js 13.x + node-version: "13.14" + npm-i: mocha@9.2.2 supertest@6.1.3 + + - name: Node.js 14.x + node-version: "14.21" + npm-i: supertest@6.1.3 + + - name: Node.js 15.x + node-version: "15" + npm-i: supertest@6.1.3 + + - name: Node.js 16.x + node-version: "16" + npm-i: supertest@6.1.3 + + - name: Node.js 17.x + node-version: "17" + npm-i: supertest@6.1.3 + + - name: Node.js 18.x + 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" + + steps: + - uses: actions/checkout@v4 + - 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 }} + if [[ "$(npm -v)" == 1.1.* ]]; then + nvm exec npm npm install -g npm@1.1 + ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm" + else + sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" + fi + 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 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 e213c9d209b78c2554e6686f165a26241303fa7d Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sun, 2 Feb 2025 13:05:03 -0500 Subject: [PATCH 11/12] nvm in macos --- .github/workflows/macos.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3246caa5..c3b58571 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: iojs-ci +name: macos-ci on: push: @@ -137,6 +137,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install nvm + shell: bash -eo pipefail -l {0} + run: | + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash - name: Install Node.js ${{ matrix.node-version }} shell: bash -eo pipefail -l {0} run: | @@ -147,8 +151,6 @@ jobs: if [[ "$(npm -v)" == 1.1.* ]]; then nvm exec npm npm install -g npm@1.1 ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm" - else - sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" fi npm config set strict-ssl false fi From 4a123fd80975dd5abd3e8e3c9c220ac1158322e3 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sun, 2 Feb 2025 13:05:21 -0500 Subject: [PATCH 12/12] remove macos --- .github/workflows/macos.yml | 184 ------------------------------------ 1 file changed, 184 deletions(-) delete mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index c3b58571..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,184 +0,0 @@ -name: macos-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 - -jobs: - test: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - name: - - Node.js 0.8 - - Node.js 0.10 - - Node.js 0.12 - - 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 - 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.10 - node-version: "0.10" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 - npm-version: "npm@2.15.1" - - - name: Node.js 0.12 - node-version: "0.12" - npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1 - npm-version: "npm@2.15.1" - - - name: Node.js 4.x - node-version: "4.9" - npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 - - - name: Node.js 5.x - node-version: "5.12" - npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2 - npm-version: npm@3.10.10 - - - name: Node.js 6.x - node-version: "6.17" - npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.3 - - - name: Node.js 7.x - node-version: "7.10" - npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.3 - - - name: Node.js 8.x - node-version: "8.17" - npm-i: mocha@7.1.2 nyc@14.1.1 supertest@6.1.3 - - - name: Node.js 9.x - node-version: "9.11" - npm-i: mocha@7.1.2 nyc@14.1.1 supertest@6.1.3 - - - name: Node.js 10.x - node-version: "10.24" - npm-i: mocha@8.4.0 supertest@6.1.3 - - - name: Node.js 11.x - node-version: "11.15" - npm-i: mocha@8.4.0 supertest@6.1.3 - - - name: Node.js 12.x - node-version: "12.22" - npm-i: mocha@9.2.2 supertest@6.1.3 - - - name: Node.js 13.x - node-version: "13.14" - npm-i: mocha@9.2.2 supertest@6.1.3 - - - name: Node.js 14.x - node-version: "14.21" - npm-i: supertest@6.1.3 - - - name: Node.js 15.x - node-version: "15" - npm-i: supertest@6.1.3 - - - name: Node.js 16.x - node-version: "16" - npm-i: supertest@6.1.3 - - - name: Node.js 17.x - node-version: "17" - npm-i: supertest@6.1.3 - - - name: Node.js 18.x - 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" - - steps: - - uses: actions/checkout@v4 - - name: Install nvm - shell: bash -eo pipefail -l {0} - run: | - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash - - 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 }} - if [[ "$(npm -v)" == 1.1.* ]]; then - nvm exec npm npm install -g npm@1.1 - ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm" - fi - 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 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