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

pr.yml

90 lines2.5 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 pull-requests: write
19​
20jobs:
21 test:
22 name: Test
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout
26 uses: actions/checkout@v5.0.0
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.3.3
33 with:
34 main-branch-name: main
35 - name: Run Checks
36 run: pnpm run lint && pnpm run build && pnpm run test
37 preview:
38 name: Preview
39 runs-on: ubuntu-latest
40 steps:
41 - name: Checkout
42 uses: actions/checkout@v5.0.0
43 with:
44 fetch-depth: 0
45 - name: Setup Tools
46 uses: tanstack/config/.github/setup@main
47 - name: Build Packages
48 run: pnpm run build
49 - name: Publish Previews
50 run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
51 - name: Compressed Size Action - DB Package
52 uses: preactjs/compressed-size-action@v2
53 with:
54 repo-token: "${{ secrets.GITHUB_TOKEN }}"
55 pattern: "./packages/db/dist/**/*.{js,mjs}"
56 comment-key: "db-package-size"
57 - name: Compressed Size Action - React DB Package
58 uses: preactjs/compressed-size-action@v2
59 with:
60 repo-token: "${{ secrets.GITHUB_TOKEN }}"
61 pattern: "./packages/react-db/dist/**/*.{js,mjs}"
62 comment-key: "react-db-package-size"
63 build-example:
64 name: Build Example Site
65 runs-on: ubuntu-latest
66 steps:
67 - name: Checkout
68 uses: actions/checkout@v5.0.0
69 - name: Setup Tools
70 uses: tanstack/config/.github/setup@main
71 - name: Build Packages
72 run: pnpm run build
73 - name: Build Example Site
74 run: |
75 cd examples/react/todo
76 pnpm build
77 build-starter:
78 name: Build Example Site
79 runs-on: ubuntu-latest
80 steps:
81 - name: Checkout
82 uses: actions/checkout@v5.0.0
83 - name: Setup Tools
84 uses: tanstack/config/.github/setup@main
85 - name: Build Packages
86 run: pnpm run build
87 - name: Build Starter Site
88 run: |
89 cd examples/react/projects
90 pnpm build