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

ci.yml

64 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:
11 - 'main'
12 - 'alpha'
13 - 'beta'
14 - 'rc'
15 - 'v4'
16​
17concurrency:
18 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
19 cancel-in-progress: true
20​
21env:
22 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
23 NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
24​
25jobs:
26 test-and-publish:
27 if: github.repository == 'TanStack/query'
28 name: 'Test & Publish'
29 runs-on: ubuntu-latest
30 steps:
31 - uses: actions/checkout@v3
32 with:
33 fetch-depth: '0'
34 - uses: pnpm/action-setup@v2.2.4
35 with:
36 version: 8
37 - uses: actions/setup-node@v3
38 with:
39 registry-url: https://registry.npmjs.org/
40 node-version-file: .nvmrc
41 cache: pnpm
42 cache-dependency-path: pnpm-lock.yaml
43 - name: Install dependencies
44 run: pnpm --filter "./packages/**" --filter query --prefer-offline install
45 - name: Run Tests
46 uses: nick-fields/retry@v2.8.3
47 with:
48 command: pnpm run test:ci --base=${{ github.event.before }}
49 timeout_minutes: 10
50 max_attempts: 3
51 - name: Publish
52 run: |
53 git config --global user.name 'Tanner Linsley'
54 git config --global user.email 'tannerlinsley@users.noreply.github.com'
55 npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
56 pnpm run cipublish
57 env:
58 GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
59 GH_TOKEN: ${{ secrets.GH_TOKEN }}
60 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
61 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62 TAG: ${{ inputs.tag }}
63 - name: Upload coverage to Codecov
64 uses: codecov/codecov-action@v3