Chore/nx agents ci #127
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: | |
| env: | |
| NX_VERBOSE_LOGGING: 'true' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify: | |
| name: sync 路 lint 路 typecheck 路 build 路 test (node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ['20', '22'] | |
| env: | |
| NX_CI_EXECUTION_ENV: 'node ${{ matrix.node }}' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - run: corepack enable | |
| - run: pnpm install --frozen-lockfile | |
| # fail fast if tsconfig project references drift from the graph | |
| - run: pnpm run sync:check | |
| - name: Start Nx Agents | |
| run: >- | |
| pnpm nx start-ci-run | |
| --distribute-on="3 linux-medium-node${{ matrix.node }}" | |
| --stop-agents-after=lint,typecheck,package,test | |
| - run: pnpm nx run-many -t lint,typecheck,package,test | |
| package-contract: | |
| name: publint + attw | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - run: corepack enable | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run package | |
| - run: pnpm run check:packages | |
| # The main verify job runs against nestjs 11 (the installed version). This job | |
| # certifies the lower bound of @automapper/nestjs's `^10 || ^11` peer range by | |
| # downgrading the @nestjs runtime to v10 and running the DI integration specs. | |
| nestjs-compat: | |
| name: nestjs 10 compat | |
| runs-on: ubuntu-latest | |
| env: | |
| NX_CI_EXECUTION_ENV: 'nestjs-compat' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - run: corepack enable | |
| - run: pnpm install --frozen-lockfile | |
| # downgrade only the @nestjs runtime; rxjs/reflect-metadata span both majors | |
| - run: pnpm --config.prefer-workspace-packages=true add -w @nestjs/common@^10 @nestjs/core@^10 @nestjs/testing@^10 @nestjs/platform-express@^10 | |
| - name: Start Nx Agents | |
| run: >- | |
| pnpm nx start-ci-run | |
| --distribute-on="3 linux-medium-node22" | |
| --stop-agents-after=test | |
| - run: pnpm nx run integration-test:test |