From 50250ef617ff5eef5b9b89e6733063e5984297e7 Mon Sep 17 00:00:00 2001 From: Carlos Serrano Date: Tue, 7 May 2024 17:04:41 +0200 Subject: [PATCH] ci: Add Node.js versions and pin dependencies in the pipeline (#26) PR-URL: https://github.com/jshttp/range-parser/pull/26 --- .github/workflows/ci.yml | 75 +++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed670c3..9da0a2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,11 +6,10 @@ on: jobs: test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: name: - - Node.js 0.6 - Node.js 0.8 - Node.js 0.10 - Node.js 0.12 @@ -26,12 +25,18 @@ jobs: - 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 include: - - name: Node.js 0.6 - node-version: "0.6" - npm-i: mocha@1.21.5 - npm-rm: nyc - name: Node.js 0.8 node-version: "0.8" @@ -68,36 +73,69 @@ jobs: - name: Node.js 6.x node-version: "6.17" + npm-i: mocha@6.2.2 nyc@14.1.1 - name: Node.js 7.x node-version: "7.10" + npm-i: mocha@6.2.2 nyc@14.1.1 - name: Node.js 8.x - node-version: "8.16" + node-version: "8.17" + npm-i: mocha@7.1.2 nyc@14.1.1 - name: Node.js 9.x node-version: "9.11" + npm-i: mocha@7.1.2 nyc@14.1.1 - name: Node.js 10.x - node-version: "10.15" + node-version: "10.24" + npm-i: mocha@8.4.0 - name: Node.js 11.x node-version: "11.15" + npm-i: mocha@8.4.0 - name: Node.js 12.x - node-version: "12.2" + node-version: "12.22" + npm-i: mocha@9.2.2 + + - name: Node.js 13.x + node-version: "13.14" + npm-i: mocha@9.2.2 + + - name: Node.js 14.x + node-version: "14.21" + + - name: Node.js 15.x + node-version: "15.14" + + - name: Node.js 16.x + node-version: "16.20" + + - name: Node.js 17.x + node-version: "17.9" + + - name: Node.js 18.x + node-version: "18.18" + + - name: Node.js 19.x + node-version: "19.9" + + - name: Node.js 20.x + node-version: "20.9" + + - name: Node.js 21.x + node-version: "21.7" + + - name: Node.js 22.x + node-version: "22.0" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Node.js ${{ matrix.node-version }} shell: bash -eo pipefail -l {0} run: | - if [[ "${{ matrix.node-version }}" == 0.6* ]]; then - sudo apt-get install g++-4.8 gcc-4.8 libssl1.0-dev - export CC=/usr/bin/gcc-4.8 - export CXX=/usr/bin/g++-4.8 - fi 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 @@ -113,7 +151,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 }}