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

ci.yml

62 lines1.8 KB

1name: ci
2​
3on:
4 workflow_dispatch:
5 inputs:
6 tag:
7 description: override release tag
8 required: false
9 push:
10 branches: ['main', 'alpha', 'beta', 'rc', 'v4']
11​
12concurrency:
13 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14 cancel-in-progress: true
15​
16env:
17 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
18​
19jobs:
20 test-and-publish:
21 name: Test & Publish
22 if: github.repository == 'TanStack/query'
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout
26 uses: actions/checkout@v4
27 with:
28 fetch-depth: '0'
29 - name: Setup pnpm
30 uses: pnpm/action-setup@v2
31 with:
32 version: 8
33 - name: Setup Node
34 uses: actions/setup-node@v4
35 with:
36 node-version-file: .nvmrc
37 cache: pnpm
38 - name: Start Nx Agents
39 run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
40 - name: Install dependencies
41 run: pnpm install --frozen-lockfile --prefer-offline
42 - name: Run Tests
43 run: pnpm run test:ci --parallel=3
44 - name: Stop Nx Agents
45 if: ${{ always() }}
46 run: npx nx-cloud stop-all-agents
47 - name: Publish
48 run: |
49 git config --global user.name 'Tanner Linsley'
50 git config --global user.email 'tannerlinsley@users.noreply.github.com'
51 npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
52 pnpm run cipublish
53 env:
54 GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
55 GH_TOKEN: ${{ secrets.GH_TOKEN }}
56 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
57 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58 TAG: ${{ inputs.tag }}
59 - name: Upload coverage to Codecov
60 uses: codecov/codecov-action@v4
61 with:
62 directory: packages