refactor!: simplify options API #44
Workflow file for this run
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: ci | |
on: | |
pull_request: | |
branches: main | |
push: | |
branches: main | |
tags: v* | |
jobs: | |
test: | |
name: Test / Node.js ${{ matrix.node-version }} / ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
node-version: ['16', '18', '20'] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Install Node.js and dependencies | |
uses: mcous/js/actions/setup@main | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Run tests | |
run: pnpm coverage | |
- name: Upload coverage | |
uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d | |
with: | |
flag-name: node-${{ matrix.node-version }}-os-${{ matrix.os }} | |
parallel: true | |
coverage: | |
name: Coverage finished | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d | |
with: | |
parallel-finished: true | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Install Node.js and dependencies | |
uses: mcous/js/actions/setup@main | |
- name: Build and check | |
run: pnpm build-and-check | |
- name: Upload publish artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: npm-dist | |
path: dist | |
deploy: | |
if: ${{ github.repository == 'mcous/vitest-when' && startsWith(github.ref, 'refs/tags/v') }} | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: [test, build] | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: https://registry.npmjs.org | |
- name: Download publish artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: npm-dist | |
path: dist | |
- name: Publish to npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |