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
19jobs:
20 minified-db:
21 name: Minified DB public API
22 runs-on: ubuntu-latest
23 steps:
24 - name: Checkout
25 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26 with:
27 persist-credentials: false
28 - name: Setup Tools
29 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
30 - name: Check private-member mangle cache
31 run: pnpm run check:mangle
32 - name: Build DB packages
33 run: pnpm --filter @tanstack/db-ivm --filter @tanstack/db build
34 - name: Check minified public API
35 run: pnpm run test:minified-db
36 - name: Check DB tests against built dist
37 run: pnpm --filter @tanstack/db test:dist
38 test:
39 name: Test
40 runs-on: ubuntu-latest
41 steps:
42 - name: Checkout
43 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44 with:
45 fetch-depth: 0
46 persist-credentials: false
47 - name: Setup Tools
48 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
49 - name: Get base and head commits for `nx affected`
50 uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # v4.4.0
51 with:
52 main-branch-name: main
53 - name: Build Packages
54 run: pnpm run build
55 - name: Typecheck Test Sources
56 run: pnpm run typecheck:tests
57 - name: Run Tests
58 run: pnpm run test
59 - name: Check dependency versions
60 run: |
61 if ! pnpm run test:sherif; then
62 echo ""
63 echo "=========================================="
64 echo "❌ Sherif found dependency version mismatches"
65 echo ""
66 echo "To fix this locally, run:"
67 echo " pnpm exec sherif --fix -i zod"
68 echo ""
69 echo "Then commit the changes to package.json files."
70 echo "=========================================="
71 exit 1
72 fi
73 preview:
74 name: Preview
75 runs-on: ubuntu-latest
76 permissions:
77 contents: read
78 pull-requests: write
79 steps:
80 - name: Checkout
81 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
82 with:
83 fetch-depth: 0
84 persist-credentials: false
85 - name: Setup Tools
86 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
87 - name: Build Packages
88 run: pnpm run build
89 - name: Publish Previews
90 run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
91 - name: Compressed Size Action - DB Package
92 uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # 2.9.1
93 with:
94 repo-token: '${{ secrets.GITHUB_TOKEN }}'
95 pattern: './packages/db/dist/**/*.{js,mjs}'
96 comment-key: 'db-package-size'
97 build-script: 'build:minified'
98 - name: Compressed Size Action - React DB Package
99 uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # 2.9.1
100 with:
101 repo-token: '${{ secrets.GITHUB_TOKEN }}'
102 pattern: './packages/react-db/dist/**/*.{js,mjs}'
103 comment-key: 'react-db-package-size'
104 build-script: 'build:minified'
105 build-example:
106 name: Build Example Site
107 runs-on: ubuntu-latest
108 steps:
109 - name: Checkout
110 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
111 with:
112 persist-credentials: false
113 - name: Setup Tools
114 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
115 - name: Build Packages
116 run: pnpm run build
117 - name: Build Example Site
118 run: |
119 cd examples/react/todo
120 pnpm build
121 build-starter:
122 name: Build Example Site
123 runs-on: ubuntu-latest
124 steps:
125 - name: Checkout
126 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
127 with:
128 persist-credentials: false
129 - name: Setup Tools
130 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
131 - name: Build Packages
132 run: pnpm run build
133 - name: Build Starter Site
134 run: |
135 cd examples/react/projects
136 cp .env.example .env
137 pnpm build