Skip to content

Commit eea1a25

Browse files
committed
refactor: run test cases depend on which files have been changed
1 parent 394c8f3 commit eea1a25

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

.github/workflows/test modules.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: lint & test
2+
3+
on:
4+
push:
5+
paths:
6+
- 'modules/**'
7+
- '!modules/**.md'
8+
pull_request:
9+
paths:
10+
- 'modules/**'
11+
- '!modules/**.md'
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v2
19+
20+
- uses: actions/setup-node@v2
21+
with:
22+
node-version: '14'
23+
24+
- name: install
25+
run: npm i
26+
27+
- name: lint
28+
run: npm run lint:modules
29+
30+
test-code-generator:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: checkout
34+
uses: actions/checkout@v2
35+
36+
- uses: actions/setup-node@v2
37+
with:
38+
node-version: '14'
39+
40+
- name: install
41+
run: npm i && npm run setup:skip-build
42+
43+
- name: test
44+
run: cd modules/code-generator && npm i && npm run build && npm test
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: lint & test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
paths:
6+
- 'packages/**'
7+
- '!packages/**.md'
8+
pull_request:
9+
paths:
10+
- 'packages/**'
11+
- '!packages/**.md'
412

513
jobs:
614
lint:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './run';
2-
export * from './init-solution';
2+
export * from './init-solution';

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"clean": "rm -rf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build",
1717
"lint": "f2elint scan -q -i ./packages/*/src",
1818
"lint:fix": "f2elint fix -i ./packages/*/src",
19+
"lint:modules": "f2elint scan -q -i ./modules/*/src",
20+
"lint:modules:fix": "f2elint fix -i ./modules/*/src",
1921
"pub": "npm run watchdog:build && lerna publish patch --force-publish --exact --no-changelog",
2022
"pub:premajor": "npm run watchdog:build && lerna publish premajor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
2123
"pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",

0 commit comments

Comments
 (0)