diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19c4daa..8aa9b49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -220,3 +220,196 @@ jobs: with: github-token: ${{ secrets.github_token }} parallel-finished: true + + # Cross-platform lanes, following the pattern merged in expressjs/multer#1464 + # and proposed in expressjs/body-parser#759, expressjs/morgan#379 and + # expressjs/compression#283: the legacy `test` job above keeps running the + # full historical matrix on ubuntu via nvm (it cannot run on the hosted + # windows/macos runners, which have no nvm), while this job exercises the + # suite on windows and macos via actions/setup-node for every Node.js version + # those runners can install natively. + test-cross-platform: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - windows-latest + name: + - 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 10.x + 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.22" + + - name: Node.js 13.x + node-version: "13.14" + + - name: Node.js 14.x + node-version: "14.19" + + - name: Node.js 15.x + node-version: "15.14" + + - name: Node.js 16.x + node-version: "16.14" + + - name: Node.js 17.x + node-version: "17.6" + + - name: Node.js 18.x + node-version: "18.14" + + - name: Node.js 19.x + node-version: "19.6" + + - name: Node.js 20.x + node-version: "20.12" + + - name: Node.js 21.x + node-version: "21.7" + + - name: Node.js 22.x + node-version: "22.1" + + # Windows on Node.js < 22 is not yet proven for this suite; keep those + # legs informational until measured, mirroring expressjs/multer#1464. + - name: Node.js 10.x + os: windows-latest + experimental: true + + - name: Node.js 11.x + os: windows-latest + experimental: true + + - name: Node.js 12.x + os: windows-latest + experimental: true + + - name: Node.js 13.x + os: windows-latest + experimental: true + + - name: Node.js 14.x + os: windows-latest + experimental: true + + - name: Node.js 15.x + os: windows-latest + experimental: true + + - name: Node.js 16.x + os: windows-latest + experimental: true + + - name: Node.js 17.x + os: windows-latest + experimental: true + + - name: Node.js 18.x + os: windows-latest + experimental: true + + - name: Node.js 19.x + os: windows-latest + experimental: true + + - name: Node.js 20.x + os: windows-latest + experimental: true + + - name: Node.js 21.x + os: windows-latest + experimental: true + + # macOS: Node.js < 16 has no darwin-arm64 builds (setup-node cannot + # install them natively and those legs would be permanently red), so + # they are skipped. 16.x-21.x run informational until measured; + # 22+ are required checks. + - name: Node.js 16.x + os: macos-latest + node-version: "16.14" + experimental: true + + - name: Node.js 17.x + os: macos-latest + node-version: "17.6" + experimental: true + + - name: Node.js 18.x + os: macos-latest + node-version: "18.14" + experimental: true + + - name: Node.js 19.x + os: macos-latest + node-version: "19.6" + experimental: true + + - name: Node.js 20.x + os: macos-latest + node-version: "20.12" + experimental: true + + - name: Node.js 21.x + os: macos-latest + node-version: "21.7" + experimental: true + + - name: Node.js 22.x + os: macos-latest + node-version: "22.0" + + continue-on-error: ${{ matrix.experimental == true }} + steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + with: + persist-credentials: false + + - name: Install Node.js ${{ matrix.node-version }} + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version: ${{ matrix.node-version }} + + - name: Install npm module(s) ${{ matrix.npm-i }} + run: npm install --save-dev ${{ matrix.npm-i }} + if: matrix.npm-i != '' + + - name: Install Node.js dependencies + run: npm install + + - name: List environment + shell: bash + run: | + echo "node@$(node -v)" + echo "npm@$(npm -v)" + npm -s ls ||: + + - name: Run tests + shell: bash + run: | + if npm -ps ls nyc | grep -q nyc; then + npm run test-ci + else + npm test + fi