Skip to content

add ci matrix

add ci matrix #3

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
name: Test (${{ matrix.label }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- label: Node
node: 18
environment: node
- label: Browser
node: 18
environment: jsdom
- label: Edge
node: 18
environment: edge-runtime
- label: Bun
node: 18
bun: canary
environment: node
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install bun
if: matrix.bun
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun }}
- run: pnpm install
- run: ${{ matrix.bun && 'bun' || 'pnpm' }} vitest --environment ${{ matrix.environment }}
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: pnpm
- run: pnpm install
- run: pnpm build
- run: pnpm circular
- run: pnpm lint
- run: pnpm dtslint
- run: pnpm docgen
- name: Create Release Pull Request or Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
id: changesets
uses: changesets/action@v1
with:
version: pnpm update-version
publish: pnpm exec changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}