build(deps): Bump the nestjs group across 1 directory with 6 updates #1339
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
| # Continuous Integration | |
| # | |
| # References: | |
| # | |
| # - https://docs.github.com/actions/learn-github-actions/contexts | |
| # - https://docs.github.com/actions/learn-github-actions/expressions | |
| # - https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs | |
| # - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request | |
| # - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#push | |
| # - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
| # - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions | |
| # - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request | |
| # - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#push | |
| # - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch | |
| # - https://github.com/actions/cache | |
| # - https://github.com/actions/cache/discussions/650 | |
| # - https://github.com/actions/checkout | |
| # - https://github.com/actions/upload-artifact | |
| # - https://github.com/docker/build-push-action | |
| # - https://github.com/docker/login-action | |
| # - https://github.com/docker/metadata-action | |
| # - https://github.com/docker/setup-buildx-action | |
| # - https://github.com/flex-development/grease | |
| # - https://github.com/hmarr/debug-action | |
| # - https://github.com/oven-sh/setup-bun | |
| --- | |
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - feat/** | |
| - hotfix/** | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| CACHE_PATH: node_modules | |
| HUSKY: 0 | |
| REF: ${{ github.head_ref || github.ref }} | |
| REF_NAME: ${{ github.head_ref || github.ref_name }} | |
| SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| preflight: | |
| if: | | |
| github.event_name == 'pull_request' || | |
| github.event.head_commit.committer.username != 'web-flow' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-key: ${{ steps.cache-key.outputs.result }} | |
| version-typescript: ${{ steps.version-typescript.outputs.result }} | |
| version: ${{ steps.version.outputs.result }} | |
| steps: | |
| - id: debug | |
| name: Print environment variables and event payload | |
| uses: hmarr/[email protected] | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: dependencies | |
| name: Install dependencies | |
| env: | |
| BUN_FROZEN_LOCKFILE: ${{ github.actor != vars.DEPENDABOT }} | |
| run: bun install ${{ env.BUN_FROZEN_LOCKFILE == 'true' && '--frozen-lockfile' || '' }} | |
| - id: cache-key | |
| name: Get cache key | |
| run: echo "result=${{ runner.os }}-${{ github.run_id }}" >>$GITHUB_OUTPUT | |
| - id: cache | |
| name: Cache dependencies | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ steps.cache-key.outputs.result }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: version | |
| name: Get manifest version | |
| run: echo "result=$(jq .version package.json -r)" >>$GITHUB_OUTPUT | |
| - id: version-typescript | |
| name: Get TypeScript version | |
| run: echo "result=$(jq .devDependencies.typescript package.json -r)" >>$GITHUB_OUTPUT | |
| commitlint: | |
| needs: preflight | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: lint | |
| name: Check commitlint status | |
| if: github.run_number != '1' | |
| run: bun run commitlint --from $SHA~${{ github.event.pull_request.commits || 1 }} --to $SHA | |
| format: | |
| needs: | |
| - commitlint | |
| - preflight | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: format | |
| name: Check code formatting | |
| run: bun run check:format | |
| lint: | |
| needs: | |
| - commitlint | |
| - preflight | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: lint | |
| name: Check lint status | |
| run: bun run check:lint | |
| spelling: | |
| needs: | |
| - commitlint | |
| - preflight | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: spelling | |
| name: Check spelling | |
| run: bun run check:spelling | |
| typescript: | |
| needs: | |
| - commitlint | |
| - preflight | |
| runs-on: ubuntu-latest | |
| env: | |
| VITEST_REPORT: ./.vitest-reports/typecheck.blob.json | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: print-typescript-version | |
| name: Print TypeScript version | |
| run: jq .devDependencies.typescript package.json -r | |
| - id: typecheck | |
| name: Run typecheck | |
| run: bun run typecheck | |
| - id: report | |
| name: Upload report | |
| uses: actions/[email protected] | |
| with: | |
| name: | | |
| ${{ format('typecheck-{0}-{1}-{2}.blob.json', needs.preflight.outputs.version-typescript, github.event.repository.name, env.SHA) }} | |
| path: ${{ env.VITEST_REPORT }} | |
| test: | |
| needs: | |
| - commitlint | |
| - preflight | |
| runs-on: ubuntu-latest | |
| env: | |
| COVERAGE_SUMMARY: ./coverage/coverage-summary.json | |
| NODE_NO_WARNINGS: 1 | |
| PCT: .total.branches.pct + .total.functions.pct + .total.lines.pct + .total.statements.pct | |
| VITEST_REPORT: ./.vitest-reports/test.blob.json | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: test | |
| name: Run tests | |
| run: | | |
| bun run test:cov --coverage.thresholds.100=false \ | |
| && echo "coverage=$(jq '${{ env.PCT }}' ${{ env.COVERAGE_SUMMARY }} -r)" >>$GITHUB_OUTPUT | |
| - id: pct | |
| name: Print coverage points | |
| run: echo ${{ steps.test.outputs.coverage }} | |
| - id: report | |
| name: Upload report | |
| uses: actions/[email protected] | |
| with: | |
| name: ${{ format('test-{0}-{1}.blob.json', github.event.repository.name, env.SHA) }} | |
| path: ${{ env.VITEST_REPORT }} | |
| - id: coverage-summary | |
| name: Upload coverage summary | |
| uses: actions/[email protected] | |
| with: | |
| name: | | |
| ${{ format('coverage-summary-{0}-{1}.json', github.event.repository.name, env.SHA) }} | |
| path: ${{ env.COVERAGE_SUMMARY }} | |
| - id: coverage-failure | |
| if: steps.test.outputs.coverage != '400' | |
| name: Coverage threshold failure (${{ steps.test.outputs.coverage }}) | |
| run: bun run test:cov:reports | |
| artifacts: | |
| needs: | |
| - commitlint | |
| - format | |
| - lint | |
| - preflight | |
| - spelling | |
| - test | |
| - typescript | |
| runs-on: ubuntu-latest | |
| env: | |
| TARFILE: | | |
| ${{ startsWith(github.head_ref || github.ref_name, 'release/') && format('@{0}-{1}-{2}.tgz', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version) || format('@{0}-{1}-{2}+{3}.tgz', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version, github.event.pull_request.head.sha || github.sha) }} | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: local-binaries | |
| name: Add local binaries to $PATH | |
| run: echo "$GITHUB_WORKSPACE/$CACHE_PATH/.bin" >> $GITHUB_PATH | |
| - id: pack | |
| name: Pack project | |
| run: bun pm pack --filename ${{ env.TARFILE }} | |
| - id: archive | |
| name: Archive production artifacts | |
| uses: actions/[email protected] | |
| with: | |
| name: ${{ env.TARFILE }} | |
| path: ${{ env.TARFILE }} | |
| changelog: | |
| needs: | |
| - artifacts | |
| - commitlint | |
| - format | |
| - lint | |
| - preflight | |
| - spelling | |
| - test | |
| - typescript | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_NO_WARNINGS: 1 | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| ref: ${{ env.REF }} | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/[email protected] | |
| with: | |
| bun-version-file: package.json | |
| - id: cache | |
| name: Restore dependencies cache | |
| uses: actions/[email protected] | |
| with: | |
| key: ${{ needs.preflight.outputs.cache-key }} | |
| path: ${{ env.CACHE_PATH }} | |
| - id: local-binaries | |
| name: Add local binaries to $PATH | |
| run: echo "$GITHUB_WORKSPACE/$CACHE_PATH/.bin" >>$GITHUB_PATH | |
| - id: summary | |
| name: Get changelog preview | |
| env: | |
| TZ: ${{ vars.TZ }} | |
| run: echo "$(grease changelog)" >>$GITHUB_STEP_SUMMARY | |
| container: | |
| needs: | |
| - artifacts | |
| - changelog | |
| - commitlint | |
| - format | |
| - lint | |
| - preflight | |
| - spelling | |
| - test | |
| - typescript | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/[email protected] | |
| with: | |
| ref: ${{ env.REF }} | |
| - id: validate | |
| name: Validate build configuration | |
| uses: docker/[email protected] | |
| with: | |
| call: check | |
| context: . | |
| - id: login | |
| name: Login to GitHub Container Registry | |
| uses: docker/[email protected] | |
| with: | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| - id: metadata | |
| name: Extract container image metadata | |
| uses: docker/[email protected] | |
| env: | |
| DOCKER_METADATA_PR_HEAD_SHA: ${{ github.event_name == 'pull_request' }} | |
| MAINTAINER: ${{ format('@{0}', github.actor) }} | |
| VERSION: ${{ format('{0}+{1}', needs.preflight.outputs.version, env.SHA) }} | |
| with: | |
| flavor: latest=false | |
| images: ghcr.io/${{ github.repository }} | |
| labels: | | |
| maintainer=${{ env.MAINTAINER }} | |
| org.opencontainers.image.authors=${{ env.MAINTAINER }} | |
| org.opencontainers.image.revision=${{ env.SHA }} | |
| org.opencontainers.image.title=${{ format('@{0}', github.repository) }} | |
| org.opencontainers.image.vendor=${{ github.repository_owner }} | |
| org.opencontainers.image.version=${{ env.VERSION }} | |
| tags: | | |
| type=edge | |
| type=raw,value=${{ env.VERSION }} | |
| type=ref,event=${{ github.event_name == 'pull_request' && 'pr' || 'branch' }} | |
| type=sha,prefix=,format=long | |
| type=sha,prefix= | |
| - id: buildx | |
| name: Set up Docker Buildx | |
| uses: docker/[email protected] | |
| - id: build-push | |
| name: Build and push container image | |
| uses: docker/[email protected] | |
| with: | |
| annotations: ${{ steps.metadata.outputs.annotations }} | |
| build-args: | | |
| NEST_DEBUG=1 | |
| context: . | |
| labels: ${{ steps.metadata.outputs.labels }} | |
| provenance: mode=max | |
| push: true | |
| sbom: true | |
| tags: ${{ steps.metadata.outputs.tags }} |