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

pr.yml

80 lines2.2 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 - name: Upload coverage to Codecov
40 uses: codecov/codecov-action@v4.6.0
41 with:
42 directory: packages
43 env:
44 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45 preview:
46 name: Preview
47 runs-on: ubuntu-latest
48 steps:
49 - name: Checkout
50 uses: actions/checkout@v6.0.1
51 with:
52 fetch-depth: 0
53 - name: Setup Tools
54 uses: tanstack/config/.github/setup@main
55 - name: Build Packages
56 run: pnpm run build:all
57 - name: Publish Previews
58 run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
59 - name: Determine commit SHA
60 id: determine-sha
61 run: |
62 echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
63 - name: Size Limit
64 uses: andresz1/size-limit-action@94bc357df29c36c8f8d50ea497c3e225c3c95d1d
65 with:
66 github_token: ${{ secrets.GITHUB_TOKEN }}
67 skip_step: install
68 build_script: build:all
69 provenance:
70 name: Provenance
71 runs-on: ubuntu-latest
72 steps:
73 - name: Checkout
74 uses: actions/checkout@v6.0.1
75 with:
76 fetch-depth: 0
77 - name: Check Provenance
78 uses: danielroe/provenance-action@v0.1.1
79 with:
80 fail-on-downgrade: true