.github/workflows/main.yml
name: CI
on: [push]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["16.x", "17.x", "18.x"]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install PNPM
uses: pnpm/action-setup@v2.2.4
with:
version: 6.0.2
- name: Install deps and build (with cache)
run: pnpm install --no-frozen-lockfile
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test -- --ci --coverage --maxWorkers=2
- name: Build
run: pnpm build
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "17"
- uses: pnpm/action-setup@v2.2.4
with:
version: 6.0.2
- run: pnpm install --no-frozen-lockfile
- run: pnpm test
- uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
debug: true