fix: coverage reports #7
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/CD | |
on: [push] | |
jobs: | |
validate: | |
name: Validate codebase for node ${{ matrix.node }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: ["18.x", "20.x"] | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: true | |
- name: Check formatting | |
run: pnpm lint | |
- name: Check typing | |
run: pnpm tsc | |
- name: Test | |
run: pnpm run test:ci | |
- name: "Report Coverage" | |
if: always() | |
uses: davelosert/vitest-coverage-report-action@v2 | |
- name: Build | |
run: pnpm build | |
release: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: validate | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: true | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Create and publish versions | |
uses: changesets/action@v1 | |
with: | |
title: "Release new version" | |
commit: "update version" | |
publish: pnpm publish:ci | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |