Replace Appveyor windows testing with GHA (#5599)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This PR moves us off of Appveyor for windows testing. We are now doing windows/linux testing on GHA. With the exception of iojs, which we are only testing on Linux and have split out to it's own workflow. We have also added npm-shrinkwrap.json to our gitignore, in order to not have to configure npm in CI to ignore it. If it's never checked in, it shouldn't exist in CI as you need to go out of your way to create it w/ npm.
authored by Jon Church · committed by GitHub · parent 2ec589c · Browse files · 4 files·+187 added−155 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+187 added−155 removed
- other:+187 added−155 removed
Provenance
- Commit
f4bd86e- Tree
740aaed- Author
Jon Church <me@jonchurch.com>- Committer
GitHub <noreply@github.com>- Parent
2ec589c
4 files changed+187 added−155 removed
modified:.github/workflows/ci.yml+115 added-153 removed
18 unmodified lines19 group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"20 cancel-in-progress: true21 22 jobs:23- test:23+ lint:24+ name: Lint25 runs-on: ubuntu-latest26+ steps:27+ - uses: actions/checkout@v428+ - name: Setup Node.js {{ matrix.node-version }}29+ uses: actions/setup-node@v430+ with:31+ node-version: 'lts/*'32+ persist-credentials: false33+34+ - name: Install dependencies35+ run: npm install --ignore-scripts --only=dev36+37+ - name: Run lint38+ run: npm run lint39+40+ test:41+ name: Run tests42 strategy:43 fail-fast: false44 matrix:28- name:29- - Node.js 0.1030- - Node.js 0.1231- - io.js 1.x32- - io.js 2.x33- - io.js 3.x34- - Node.js 4.x35- - Node.js 5.x36- - Node.js 6.x37- - Node.js 7.x38- - Node.js 8.x39- - Node.js 9.x40- - Node.js 10.x41- - Node.js 11.x42- - Node.js 12.x43- - Node.js 13.x44- - Node.js 14.x45- - Node.js 15.x46- - Node.js 16.x47- - Node.js 17.x48- - Node.js 18.x49- - Node.js 19.x50- - Node.js 20.x51- - Node.js 21.x52- - Node.js 22.x53-45+ os: [ubuntu-latest, windows-latest]46+ node-version:47+ - "0.10"48+ - "0.12"49+ - "4"50+ - "5"51+ - "6"52+ - "7"53+ - "8"54+ - "9"55+ - "10"56+ - "11"57+ - "12"58+ - "13"59+ - "14"60+ - "15"61+ - "16"62+ - "17"63+ - "18"64+ - "19"65+ - "20"66+ - "21"67+ - "22"68+ # Use supported versions of our testing tools under older versions of Node69+ # Install npm in some specific cases where we need to70 include:55- - name: Node.js 0.1056- node-version: "0.10"57- npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.071+ - node-version: "0.10"72+ npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0"73+ # Npm isn't being installed on windows w/ setup-node for74+ # 0.10 and 0.12, which will end up choking when npm uses es675+ npm-version: "npm@2.15.1"76 59- - name: Node.js 0.1260- node-version: "0.12"61- npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.077+ - node-version: "0.12"78+ npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0"79+ npm-version: "npm@2.15.11"80 63- - name: io.js 1.x64- node-version: "1"65- npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.081+ - node-version: "4"82+ npm-i: "mocha@5.2.0 nyc@11.9.0 supertest@3.4.2"83 67- - name: io.js 2.x68- node-version: "2"69- npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.084+ - node-version: "5"85+ npm-i: "mocha@5.2.0 nyc@11.9.0 supertest@3.4.2"86+ # fixes https://github.com/npm/cli/issues/68187+ npm-version: "npm@3.10.10"88 71- - name: io.js 3.x72- node-version: "3"73- npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.089+ - node-version: "6"90+ npm-i: "mocha@6.2.2 nyc@14.1.1 supertest@3.4.2"91 75- - name: Node.js 4.x76- node-version: "4"77- npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.292+ - node-version: "7"93+ npm-i: "mocha@6.2.2 nyc@14.1.1 supertest@6.1.6"94 79- - name: Node.js 5.x80- node-version: "5"81- npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.295+ - node-version: "8"96+ npm-i: "mocha@7.2.0 nyc@14.1.1"97 83- - name: Node.js 6.x84- node-version: "6"85- npm-i: mocha@6.2.2 nyc@14.1.1 supertest@3.4.298+ - node-version: "9"99+ npm-i: "mocha@7.2.0 nyc@14.1.1"100 87- - name: Node.js 7.x88- node-version: "7"89- npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6101+ - node-version: "10"102+ npm-i: "mocha@8.4.0"103 91- - name: Node.js 8.x92- node-version: "8"93- npm-i: mocha@7.2.0 nyc@14.1.1104+ - node-version: "11"105+ npm-i: "mocha@8.4.0"106 95- - name: Node.js 9.x96- node-version: "9"97- npm-i: mocha@7.2.0 nyc@14.1.1107+ - node-version: "12"108+ npm-i: "mocha@9.2.2"109 99- - name: Node.js 10.x100- node-version: "10"101- npm-i: mocha@8.4.0110+ - node-version: "13"111+ npm-i: "mocha@9.2.2"112 103- - name: Node.js 11.x104- node-version: "11"105- npm-i: mocha@8.4.0106-107- - name: Node.js 12.x108- node-version: "12"109- npm-i: mocha@9.2.2110-111- - name: Node.js 13.x112- node-version: "13"113- npm-i: mocha@9.2.2114-115- - name: Node.js 14.x116- node-version: "14"117-118- - name: Node.js 15.x119- node-version: "15"120-121- - name: Node.js 16.x122- node-version: "16"123-124- - name: Node.js 17.x125- node-version: "17"126-127- - name: Node.js 18.x128- node-version: "18"129-130- - name: Node.js 19.x131- node-version: "19"132-133- - name: Node.js 20.x134- node-version: "20"135-136- - name: Node.js 21.x137- node-version: "21"138-139- - name: Node.js 22.x140- node-version: "22"141-113+ runs-on: ${{ matrix.os }}114 steps:143- - uses: actions/checkout@v4115+ - uses: actions/checkout@v4116+ with:117+ persist-credentials: false118 145- - name: Install Node.js ${{ matrix.node-version }}146- shell: bash -eo pipefail -l {0}147- run: |148- nvm install --default ${{ matrix.node-version }}149- dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"119+ - name: Setup Node.js ${{ matrix.node-version }}120+ uses: actions/setup-node@v4121+ with:122+ node-version: ${{ matrix.node-version }}123 151- - name: Install npm module(s) ${{ matrix.npm-i }}152- run: npm install --save-dev ${{ matrix.npm-i }}153- if: matrix.npm-i != ''124+ - name: Npm version fixes125+ if: ${{matrix.npm-version != ''}}126+ run: npm install -g ${{ matrix.npm-version }}127 155- - name: Remove non-test dependencies156- run: npm rm --silent --save-dev connect-redis128+ - name: Configure npm loglevel129+ run: |130+ npm config set loglevel error131+ shell: bash132 158- - name: Setup Node.js version-specific dependencies159- shell: bash160- run: |161- # eslint for linting162- # - remove on Node.js < 12163- if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 12 ]]; then164- node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \165- grep -E '^eslint(-|$)' | \166- sort -r | \167- xargs -n1 npm rm --silent --save-dev168- fi133+ - name: Install dependencies134+ run: npm install135 170- - name: Install Node.js dependencies171- run: npm install136+ - name: Install Node version specific dev deps137+ if: ${{ matrix.npm-i != '' }}138+ run: npm install --save-dev ${{ matrix.npm-i }}139 173- - name: List environment174- id: list_env175- shell: bash176- run: |177- echo "node@$(node -v)"178- echo "npm@$(npm -v)"179- npm -s ls ||:180- (npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print $2 "=" $3 }' >> "$GITHUB_OUTPUT"140+ - name: Remove non-test dependencies141+ run: npm rm --silent --save-dev connect-redis142 182- - name: Run tests183- shell: bash184- run: |185- npm run test-ci186- cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"143+ - name: Output Node and NPM versions144+ run: |145+ echo "Node.js version: $(node -v)"146+ echo "NPM version: $(npm -v)"147 188- - name: Lint code189- if: steps.list_env.outputs.eslint != ''190- run: npm run lint148+ - name: Run tests149+ shell: bash150+ run: |151+ npm run test-ci152+ cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"153 192- - name: Collect code coverage193- run: |194- mv ./coverage "./${{ matrix.name }}"195- mkdir ./coverage196- mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"154+ - name: Collect code coverage155+ run: |156+ mv ./coverage "./${{ matrix.node-version }}"157+ mkdir ./coverage158+ mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"159 198- - name: Upload code coverage199- uses: actions/upload-artifact@v3200- with:201- name: coverage202- path: ./coverage203- retention-days: 1160+ - name: Upload code coverage161+ uses: actions/upload-artifact@v3162+ with:163+ name: coverage164+ path: ./coverage165+ retention-days: 1166 167 coverage:168 needs: test169 runs-on: ubuntu-latest21 unmodified linesadded:.github/workflows/iojs.yml+69 added
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869name: iojs-ci
on: push: branches: - master - '4.x' 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
modified:.gitignore+1 added
1 # npm2 node_modules3 package-lock.json4+npm-shrinkwrap.json5 *.log6 *.gz7 8 # Coveralls8 unmodified linesmodified:package.json+2 added-2 removed
89 unmodified lines909192939495949596979889 unmodified lines ], "scripts": { "lint": "eslint .", "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test", "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test", "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" }}