ci: migrate workflows to nx agents #342
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: PR | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'media/**' | |
| - 'README.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
| NX_CLOUD_CONTINUOUS_ASSIGNMENT: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Tools | |
| uses: TanStack/config/.github/setup@b313637fa7d314532b98638f6b57b7b9c169d390 # main | |
| - name: Get base and head commits for `nx affected` | |
| uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # v4.4.0 | |
| with: | |
| main-branch-name: main | |
| - name: Start Nx Agents | |
| run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion | |
| - name: Run Checks | |
| run: | | |
| pnpm nx record -- pnpm exec tsc --noEmit | |
| pnpm nx affected --targets=test:eslint,test:sherif,test:knip,test:docs,test:lib,test:types,build --exclude='examples/**' | |
| - name: Complete Nx Agents | |
| if: ${{ always() }} | |
| run: npx nx-cloud complete-ci-run | |
| preview: | |
| name: Preview | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Tools | |
| uses: TanStack/config/.github/setup@b313637fa7d314532b98638f6b57b7b9c169d390 # main | |
| - name: Start Nx Agents | |
| run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion | |
| - name: Build Packages | |
| run: pnpm nx run-many --targets=build --exclude='examples/**' | |
| - name: Publish Previews | |
| run: pnpx pkg-pr-new publish --pnpm './packages/*' | |
| - name: Complete Nx Agents | |
| if: ${{ always() }} | |
| run: npx nx-cloud complete-ci-run |