chore(ci): update pnpm and matrix versions #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: | |
push: | |
branches: | |
- master | |
- next | |
paths-ignore: | |
- 'bench/**' | |
- 'examples/**' | |
pull_request: | |
branches: | |
- master | |
- next | |
paths-ignore: | |
- 'bench/**' | |
- 'examples/**' | |
jobs: | |
test: | |
name: Node.js v${{ matrix.nodejs }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
nodejs: [10, 12, 14, 16, 18] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.nodejs }} | |
- name: (env) pnpm | |
if: matrix.nodejs < 16 | |
run: npm install -g pnpm@5 # supports Node 10.x | |
- name: (env) pnpm | |
if: matrix.nodejs >= 16 | |
run: curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm | |
- name: (env) cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ matrix.nodejs }}-${{ hashFiles('**/package.json') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.nodejs }}- | |
- name: Install | |
run: | | |
pnpm install | |
pnpm add -g nyc | |
- name: Linter | |
run: pnpm linter | |
- name: Test w/ Coverage | |
run: nyc --include=packages pnpm test | |
- name: Report | |
if: matrix.nodejs >= 18 | |
run: | | |
nyc report --reporter=text-lcov > coverage.lcov | |
bash <(curl -s https://codecov.io/bash) | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |