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

pr.yml

115 lines3.8 KB

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 test:
21 name: Test
22 runs-on: ubuntu-latest
23 steps:
24 - name: Checkout
25 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26 with:
27 fetch-depth: 0
28 persist-credentials: false
29 - name: Setup Tools
30 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
31 - name: Get base and head commits for `nx affected`
32 uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # 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 permissions:
55 contents: read
56 pull-requests: write
57 steps:
58 - name: Checkout
59 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
60 with:
61 fetch-depth: 0
62 persist-credentials: false
63 - name: Setup Tools
64 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
65 - name: Build Packages
66 run: pnpm run build
67 - name: Publish Previews
68 run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
69 - name: Compressed Size Action - DB Package
70 uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # 2.9.1
71 with:
72 repo-token: '${{ secrets.GITHUB_TOKEN }}'
73 pattern: './packages/db/dist/**/*.{js,mjs}'
74 comment-key: 'db-package-size'
75 build-script: 'build:minified'
76 - name: Compressed Size Action - React DB Package
77 uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # 2.9.1
78 with:
79 repo-token: '${{ secrets.GITHUB_TOKEN }}'
80 pattern: './packages/react-db/dist/**/*.{js,mjs}'
81 comment-key: 'react-db-package-size'
82 build-script: 'build:minified'
83 build-example:
84 name: Build Example Site
85 runs-on: ubuntu-latest
86 steps:
87 - name: Checkout
88 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
89 with:
90 persist-credentials: false
91 - name: Setup Tools
92 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
93 - name: Build Packages
94 run: pnpm run build
95 - name: Build Example Site
96 run: |
97 cd examples/react/todo
98 pnpm build
99 build-starter:
100 name: Build Example Site
101 runs-on: ubuntu-latest
102 steps:
103 - name: Checkout
104 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
105 with:
106 persist-credentials: false
107 - name: Setup Tools
108 uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
109 - name: Build Packages
110 run: pnpm run build
111 - name: Build Starter Site
112 run: |
113 cd examples/react/projects
114 cp .env.example .env
115 pnpm build