Skip to content

Commit 1aeb716

Browse files
committed
ci/cd: add test workflow; chore: split test and build steps
1 parent 0909ad7 commit 1aeb716

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.github/workflows/test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
job:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- uses: pnpm/action-setup@v4
16+
name: Install pnpm
17+
with:
18+
run_install: false
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: 'pnpm'
25+
26+
- name: Install dependencies
27+
run: pnpm install
28+
29+
- name: Tests the project
30+
run: pnpm test:coverage

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# mobx-tanstack-query
44

5-
[![NPM version][npm-image]][npm-url] [![build status][github-actions-image]][github-actions-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
5+
[![NPM version][npm-image]][npm-url] [![test status][github-test-actions-image]][github-actions-url] [![build status][github-build-actions-image]][github-actions-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
66

77

88
[npm-image]: http://img.shields.io/npm/v/mobx-tanstack-query.svg
99
[npm-url]: http://npmjs.org/package/mobx-tanstack-query
10-
[github-actions-image]: https://github.com/js2me/mobx-tanstack-query/workflows/Build/badge.svg
10+
[github-test-actions-image]: https://github.com/js2me/mobx-tanstack-query/workflows/Test/badge.svg
11+
[github-build-actions-image]: https://github.com/js2me/mobx-tanstack-query/workflows/Build/badge.svg
1112
[github-actions-url]: https://github.com/js2me/mobx-tanstack-query/actions
1213
[download-image]: https://img.shields.io/npm/dm/mobx-tanstack-query.svg
1314
[download-url]: https://npmjs.org/package/mobx-tanstack-query

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"version": "3.1.32",
44
"scripts": {
55
"clean": "rimraf dist",
6-
"check": "eslint . --fix && pnpm test:coverage",
6+
"check": "eslint . --fix",
77
"prebuild": "npm run clean && npm run check",
88
"build": "tsc && node ./post-build.mjs",
99
"pub": "PUBLISH=true pnpm run build",
10+
"prepublish": "pnpm test",
1011
"pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",
1112
"pub:minor": "PUBLISH=true PUBLISH_VERSION=minor pnpm run build",
1213
"pub:major": "PUBLISH=true PUBLISH_VERSION=major pnpm run build",

0 commit comments

Comments
 (0)