Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

pr.yml

74 lines2.0 KB

1name: PR
2​
3on:
4 pull_request:
5​
6concurrency:
7 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
8 cancel-in-progress: true
9​
10env:
11 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
12​
13permissions:
14 contents: read
15 pull-requests: write
16​
17jobs:
18 test:
19 name: Test
20 runs-on: ubuntu-latest
21 steps:
22 - name: Checkout
23 uses: actions/checkout@v6.0.1
24 with:
25 fetch-depth: 0
26 - name: Start Nx Agents
27 run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
28 - name: Setup Tools
29 uses: tanstack/config/.github/setup@main
30 - name: Get base and head commits for `nx affected`
31 uses: nrwl/nx-set-shas@v4.4.0
32 with:
33 main-branch-name: main
34 - name: Run Checks
35 run: pnpm run test:pr
36 - name: Stop Nx Agents
37 if: ${{ always() }}
38 run: npx nx-cloud stop-all-agents
39 preview:
40 name: Preview
41 runs-on: ubuntu-latest
42 steps:
43 - name: Checkout
44 uses: actions/checkout@v6.0.1
45 with:
46 fetch-depth: 0
47 - name: Setup Tools
48 uses: tanstack/config/.github/setup@main
49 - name: Build Packages
50 run: pnpm run build:all
51 - name: Publish Previews
52 run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
53 - name: Determine commit SHA
54 id: determine-sha
55 run: |
56 echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
57 - name: Size Limit
58 uses: andresz1/size-limit-action@94bc357df29c36c8f8d50ea497c3e225c3c95d1d
59 with:
60 github_token: ${{ secrets.GITHUB_TOKEN }}
61 skip_step: install
62 build_script: build:all
63 provenance:
64 name: Provenance
65 runs-on: ubuntu-latest
66 steps:
67 - name: Checkout
68 uses: actions/checkout@v6.0.1
69 with:
70 fetch-depth: 0
71 - name: Check Provenance
72 uses: danielroe/provenance-action@v0.1.1
73 with:
74 fail-on-downgrade: true