Open History to see the last commit
1name: PR
2
3on:
4 pull_request:
5
6 # Allows you to run this workflow manually from the Actions tab
7 workflow_dispatch:
8
9concurrency:
10 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11 cancel-in-progress: true
12
13env:
14 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
15
16permissions:
17 contents: read
18 pull-requests: write
19
20jobs:
21 test:
22 name: Test
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout
26 uses: actions/checkout@v6.0.1
27 with:
28 fetch-depth: 0
29 - name: Setup Tools
30 uses: tanstack/config/.github/setup@main
31 - name: Get base and head commits for `nx affected`
32 uses: nrwl/nx-set-shas@v4.4.0
33 with:
34 main-branch-name: main
35 - name: Run Checks
36 run: pnpm run build && pnpm run test
37 - name: Check dependency versions
38 run: |
39 if ! pnpm run test:sherif; then
40 echo ""
41 echo "=========================================="
42 echo "❌ Sherif found dependency version mismatches"
43 echo ""
44 echo "To fix this locally, run:"
45 echo " pnpm exec sherif --fix -i zod"
46 echo ""
47 echo "Then commit the changes to package.json files."
48 echo "=========================================="
49 exit 1
50 fi
51 preview:
52 name: Preview
53 runs-on: ubuntu-latest
54 steps:
55 - name: Checkout
56 uses: actions/checkout@v6.0.1
57 with:
58 fetch-depth: 0
59 - name: Setup Tools
60 uses: tanstack/config/.github/setup@main
61 - name: Build Packages
62 run: pnpm run build
63 - name: Publish Previews
64 run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
65 - name: Compressed Size Action - DB Package
66 uses: preactjs/compressed-size-action@v2
67 with:
68 repo-token: '${{ secrets.GITHUB_TOKEN }}'
69 pattern: './packages/db/dist/**/*.{js,mjs}'
70 comment-key: 'db-package-size'
71 build-script: 'build:minified'
72 - name: Compressed Size Action - React DB Package
73 uses: preactjs/compressed-size-action@v2
74 with:
75 repo-token: '${{ secrets.GITHUB_TOKEN }}'
76 pattern: './packages/react-db/dist/**/*.{js,mjs}'
77 comment-key: 'react-db-package-size'
78 build-script: 'build:minified'
79 build-example:
80 name: Build Example Site
81 runs-on: ubuntu-latest
82 steps:
83 - name: Checkout
84 uses: actions/checkout@v6.0.1
85 - name: Setup Tools
86 uses: tanstack/config/.github/setup@main
87 - name: Build Packages
88 run: pnpm run build
89 - name: Build Example Site
90 run: |
91 cd examples/react/todo
92 pnpm build
93 build-starter:
94 name: Build Example Site
95 runs-on: ubuntu-latest
96 steps:
97 - name: Checkout
98 uses: actions/checkout@v6.0.1
99 - name: Setup Tools
100 uses: tanstack/config/.github/setup@main
101 - name: Build Packages
102 run: pnpm run build
103 - name: Build Starter Site
104 run: |
105 cd examples/react/projects
106 cp .env.example .env
107 pnpm build