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

test-and-publish.yml

53 lines1.5 KB

1name: react-query tests
2​
3on:
4 push:
5 branches:
6 - 'main'
7 - 'next'
8 - 'beta'
9 - '1.x'
10 - '2.x'
11 pull_request:
12​
13jobs:
14 test:
15 name: 'Node ${{ matrix.node }}'
16 runs-on: ubuntu-latest
17 strategy:
18 matrix:
19 node: [12, 14, 16]
20 steps:
21 - uses: actions/checkout@v2
22 - uses: actions/setup-node@v2
23 with:
24 node-version: ${{ matrix.node }}
25 - name: Install dependencies
26 uses: bahmutov/npm-install@v1
27 - run: yarn test:ci
28 - run: yarn test:size
29 if: matrix.node == '16'
30 env:
31 BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
32 - name: Upload coverage to Codecov
33 uses: codecov/codecov-action@v2
34​
35 publish-module:
36 name: 'Publish Module to NPM'
37 needs: test
38 # publish only when merged in main on original repo, not on PR
39 if: github.repository == 'TanStack/query' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/1.x' || github.ref == 'refs/heads/2.x')
40 runs-on: ubuntu-latest
41 steps:
42 - uses: actions/checkout@v2
43 - uses: actions/setup-node@v2
44 with:
45 node-version: 14
46 registry-url: https://registry.npmjs.org/
47 - name: Install dependencies
48 uses: bahmutov/npm-install@v1
49 - run: yarn build
50 - run: npx semantic-release@17
51 env:
52 NODE_AUTH_TOKEN: ${{secrets.npm_token}}
53 GH_TOKEN: ${{secrets.GH_TOKEN}}