Upgrade version to 2.5.0 #190
Workflow file for this run
This file contains hidden or 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: [push] | |
| jobs: | |
| build: | |
| name: Build, Lint, & Test Project | |
| runs-on: ubuntu-latest | |
| outputs: | |
| coverage: ${{ steps.coverage.outputs.coverage }} | |
| steps: | |
| # Download the repository code to the GitHub Actions runner | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Install pnpm package manager which is used by this project | |
| # This ensures we use the same package manager as in development | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: "10.13.1" | |
| # Install Node.js runtime and configure NPM registry authentication | |
| # Cache pnpm dependencies to speed up future workflow runs | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.17.1" | |
| registry-url: "https://registry.npmjs.org" | |
| cache: 'pnpm' | |
| # Install all project dependencies using pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| # Build the package and prepare it for publishing | |
| # This runs the build script that builds the ESM/CJS versions and copies files | |
| - name: Build package for publishing | |
| run: pnpm run build | |
| # Run code linting to check for style and quality issues | |
| - name: Run linter | |
| run: pnpm run lint | |
| # Run tests with coverage reporting and export coverage percentage | |
| - name: Run tests | |
| id: coverage | |
| run: | | |
| pnpm vitest run --coverage | |
| COVERAGE=$(cat ./coverage/coverage-summary.json | jq '.total.statements.pct') | |
| echo "Coverage: ${COVERAGE}%" | |
| echo "coverage=${COVERAGE}" >> $GITHUB_OUTPUT | |
| # Update coverage badge with the test coverage percentage (main branch only) | |
| - name: Update coverage badge | |
| if: github.ref == 'refs/heads/main' | |
| run: curl -I "https://badge.egjiri.com/node-kit?coverage=${{ steps.coverage.outputs.coverage }}&token=${{ secrets.BADGE_API_KEY }}" |