Skip to content
Myr

💚 add legacy CI, clean up

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ctcpip · committed by ctcpip · parent 4b3b8cc · Browse files · 2 files+188 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+188 added−20 removed

  • other:+188 added−20 removed

2 files+188 added−20 removed

modified:.github/workflows/ci.yml+6 added-20 removed
added:.github/workflows/legacy.yml+182 added
1name: legacy23on:4- pull_request5- push67jobs:8 test:9 runs-on: ubuntu-latest10 strategy:11 fail-fast: false12 matrix:13 name:14 - Node.js 4.015 - Node.js 4.x16 - Node.js 5.x17 - Node.js 6.x18 - Node.js 7.x19 - Node.js 8.x20 - Node.js 9.x21 - Node.js 10.x22 - Node.js 11.x23 - Node.js 12.x24 - Node.js 13.x25 - Node.js 14.x26 - Node.js 15.x27 - Node.js 16.x28 - Node.js 17.x2930 include:31 - name: Node.js 4.032 node-version: "4.0"33 npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.23435 - name: Node.js 4.x36 node-version: "4.9"37 npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.23839 - name: Node.js 5.x40 node-version: "5.12"41 npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.24243 - name: Node.js 6.x44 node-version: "6.17"45 npm-i: mocha@6.2.2 nyc@14.1.1 supertest@3.4.24647 - name: Node.js 7.x48 node-version: "7.10"49 npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.65051 - name: Node.js 8.x52 node-version: "8.17"53 npm-i: mocha@7.2.0 nyc@14.1.15455 - name: Node.js 9.x56 node-version: "9.11"57 npm-i: mocha@7.2.0 nyc@14.1.15859 - name: Node.js 10.x60 node-version: "10.24"61 npm-i: mocha@8.4.06263 - name: Node.js 11.x64 node-version: "11.15"65 npm-i: mocha@8.4.06667 - name: Node.js 12.x68 node-version: "12.22"69 npm-i: mocha@9.2.27071 - name: Node.js 13.x72 node-version: "13.14"73 npm-i: mocha@9.2.27475 - name: Node.js 14.x76 node-version: "14.20"7778 - name: Node.js 15.x79 node-version: "15.14"8081 - name: Node.js 16.x82 node-version: "16.20"8384 - name: Node.js 17.x85 node-version: "17.9"8687 steps:88 - uses: actions/checkout@v48990 - name: Install Node.js ${{ matrix.node-version }}91 shell: bash -eo pipefail -l {0}92 run: |93 nvm install --default ${{ matrix.node-version }}94 dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"9596 - name: Configure npm97 run: |98 npm config set loglevel error99 if [[ "$(npm config get package-lock)" == "true" ]]; then100 npm config set package-lock false101 else102 npm config set shrinkwrap false103 fi104105 - name: Install npm module(s) ${{ matrix.npm-i }}106 run: npm install --save-dev ${{ matrix.npm-i }}107 if: matrix.npm-i != ''108109 - name: Remove non-test dependencies110 run: npm rm --silent --save-dev connect-redis111112 - name: Setup Node.js version-specific dependencies113 shell: bash114 run: |115 # eslint for linting116 # - remove on Node.js < 12117 if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 12 ]]; then118 node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \119 grep -E '^eslint(-|$)' | \120 sort -r | \121 xargs -n1 npm rm --silent --save-dev122 fi123124 - name: Install Node.js dependencies125 run: npm install126127 - name: List environment128 id: list_env129 shell: bash130 run: |131 echo "node@$(node -v)"132 echo "npm@$(npm -v)"133 npm -s ls ||:134 (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT"135136 - name: Run tests137 shell: bash138 run: |139 npm run test-ci140 cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"141142 - name: Lint code143 if: steps.list_env.outputs.eslint != ''144 run: npm run lint145146 - name: Collect code coverage147 run: |148 mv ./coverage "./${{ matrix.name }}"149 mkdir ./coverage150 mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"151152 - name: Upload code coverage153 uses: actions/upload-artifact@v3154 with:155 name: coverage156 path: ./coverage157 retention-days: 1158159 coverage:160 needs: test161 runs-on: ubuntu-latest162 steps:163 - uses: actions/checkout@v4164165 - name: Install lcov166 shell: bash167 run: sudo apt-get -y install lcov168169 - name: Collect coverage reports170 uses: actions/download-artifact@v3171 with:172 name: coverage173 path: ./coverage174175 - name: Merge coverage reports176 shell: bash177 run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info178179 - name: Upload coverage report180 uses: coverallsapp/github-action@master181 with:182 github-token: ${{ secrets.GITHUB_TOKEN }}