chore(deps): bump @nestjs/common from 11.1.17 to 11.1.18 #170
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, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Quality (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| run: pnpm typecheck | |
| - name: Lint | |
| if: matrix.node-version == 22 | |
| run: pnpm lint | |
| - name: Format check | |
| if: matrix.node-version == 22 | |
| run: pnpm format:check | |
| - name: Test with coverage | |
| run: | | |
| # coverage-v8 uses node:inspector/promises (Node 19+), so run coverage only on Node 20+ | |
| if [ "${{ matrix.node-version }}" = "18" ]; then | |
| pnpm test | |
| else | |
| pnpm test:coverage | |
| fi | |
| - name: Upload coverage | |
| if: matrix.node-version == 22 | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 14 | |
| - name: Build | |
| run: pnpm build | |
| - name: Check package size | |
| run: | | |
| SIZE=$(du -sk dist/ | cut -f1) | |
| echo "📦 Package size: ${SIZE}KB" | |
| if [ "$SIZE" -gt 512 ]; then | |
| echo "::warning::Package size (${SIZE}KB) exceeds 512KB" | |
| fi | |
| publish-dry-run: | |
| name: Publish dry run | |
| runs-on: ubuntu-latest | |
| needs: quality | |
| if: github.event_name == 'pull_request' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - name: Pack and report | |
| id: pack | |
| run: | | |
| OUTPUT=$(npm pack --dry-run 2>&1) | |
| echo "$OUTPUT" | |
| PKG_SIZE=$(echo "$OUTPUT" | grep 'package size' | sed 's/npm notice //') | |
| UNPACKED=$(echo "$OUTPUT" | grep 'unpacked size' | sed 's/npm notice //') | |
| TOTAL=$(echo "$OUTPUT" | grep 'total files' | sed 's/npm notice //') | |
| echo "pkg_size=${PKG_SIZE}" >> "$GITHUB_OUTPUT" | |
| echo "unpacked=${UNPACKED}" >> "$GITHUB_OUTPUT" | |
| echo "total=${TOTAL}" >> "$GITHUB_OUTPUT" | |
| - name: Comment on PR | |
| uses: actions/github-script@v8 | |
| env: | |
| PKG_SIZE: ${{ steps.pack.outputs.pkg_size }} | |
| UNPACKED: ${{ steps.pack.outputs.unpacked }} | |
| TOTAL: ${{ steps.pack.outputs.total }} | |
| with: | |
| script: | | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const marker = '<!-- sdk-publish-dry-run -->'; | |
| const existing = comments.find(c => c.body?.includes(marker)); | |
| const split = (s) => { | |
| const [k, ...v] = (s || '').split(':'); | |
| return [k.trim(), v.join(':').trim()]; | |
| }; | |
| const [sizeK, sizeV] = split(process.env.PKG_SIZE); | |
| const [unpackK, unpackV] = split(process.env.UNPACKED); | |
| const [totalK, totalV] = split(process.env.TOTAL); | |
| const body = [ | |
| marker, | |
| '### 📦 Publish dry run', | |
| '', | |
| '| Metric | Value |', | |
| '|--------|-------|', | |
| `| ${sizeK} | ${sizeV} |`, | |
| `| ${unpackK} | ${unpackV} |`, | |
| `| ${totalK} | ${totalV} |`, | |
| '', | |
| `Commit: \`${context.sha.slice(0, 7)}\``, | |
| ].join('\n'); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } |