feat!: modernize tooling and migrate to Standard Schema #9
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: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: pnpm/action-setup@5d445ecbfcb90fdf1556a629d018c79e97ff973b # v6.0.6 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24.15.0 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run lint | |
| - run: pnpm run format:check | |
| - run: pnpm run typecheck | |
| - run: pnpm run test | |
| - run: pnpm run test:coverage | |
| - run: pnpm run build | |
| - name: Post coverage comment | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| COMMENT_MARKER="<!-- izod-coverage -->" | |
| BODY="$COMMENT_MARKER | |
| ## Coverage Report | |
| | Package | Statements | Branches | Functions | Lines | | |
| |---------|-----------|----------|-----------|-------|" | |
| for pkg in packages/core packages/react; do | |
| SUMMARY="$pkg/coverage/coverage-summary.json" | |
| if [ ! -f "$SUMMARY" ]; then | |
| continue | |
| fi | |
| NAME=$(jq -r '.total | "\(.statements.pct)% | \(.branches.pct)% | \(.functions.pct)% | \(.lines.pct)%"' "$SUMMARY") | |
| PKG_NAME=$(jq -r '.name' "$pkg/package.json") | |
| BODY="$BODY | |
| | \`$PKG_NAME\` | $NAME |" | |
| done | |
| BODY="$BODY | |
| *Updated by CI — $(date -u '+%Y-%m-%d %H:%M UTC')*" | |
| EXISTING=$(gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \ | |
| --jq ".[] | select(.body | startswith(\"$COMMENT_MARKER\")) | .id" \ | |
| | head -1) | |
| if [ -n "$EXISTING" ]; then | |
| gh api "repos/${{ github.repository }}/issues/comments/${EXISTING}" \ | |
| -X PATCH -f body="$BODY" | |
| else | |
| gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \ | |
| -X POST -f body="$BODY" | |
| fi |