Skip to content

Commit eb73686

Browse files
liujupingLeoYuan
authored andcommitted
chore: added codecov with ci git action
1 parent d1c9838 commit eb73686

File tree

6 files changed

+132
-5
lines changed

6 files changed

+132
-5
lines changed

.github/workflows/ci.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
upload-designer-codecov:
13+
runs-on: ubuntu-latest
14+
# if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }}
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v2
18+
19+
- uses: actions/setup-node@v2
20+
with:
21+
node-version: '14'
22+
23+
- name: install
24+
run: npm i && npm run setup:skip-build
25+
26+
- name: test designer
27+
run: cd packages/designer && npm run test:cov && cd ../..
28+
29+
- name: Upload designer coverage to Codecov
30+
uses: codecov/codecov-action@v3
31+
with:
32+
# working-directory: packages/designer
33+
directory: ./packages/designer/coverage
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
name: designer
36+
fail_ci_if_error: true
37+
verbose: true
38+
39+
upload-renderer-core:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: checkout
43+
uses: actions/checkout@v2
44+
45+
- uses: actions/setup-node@v2
46+
with:
47+
node-version: '14'
48+
49+
- name: install
50+
run: npm i && npm run setup:skip-build
51+
52+
- name: test renderer-core
53+
run: cd packages/renderer-core && npm run test:cov && cd ../..
54+
55+
- name: Upload renderer-core coverage to Codecov
56+
uses: codecov/codecov-action@v3
57+
with:
58+
# working-directory: packages/designer
59+
directory: ./packages/renderer-core/coverage
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
name: renderer-core
62+
fail_ci_if_error: true
63+
verbose: true
64+
65+
upload-react-simulator-renderer:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: checkout
69+
uses: actions/checkout@v2
70+
71+
- uses: actions/setup-node@v2
72+
with:
73+
node-version: '14'
74+
75+
- name: install
76+
run: npm i && npm run setup:skip-build
77+
78+
- name: test react-simulator-renderer
79+
run: cd packages/react-simulator-renderer && npm run test:cov && cd ../..
80+
81+
- name: Upload react-simulator-renderer coverage to Codecov
82+
uses: codecov/codecov-action@v3
83+
with:
84+
# working-directory: packages/designer
85+
directory: ./packages/react-simulator-renderer/coverage
86+
token: ${{ secrets.CODECOV_TOKEN }}
87+
name: react-simulator-renderer
88+
fail_ci_if_error: true
89+
verbose: true
90+
91+
upload-code-generator:
92+
runs-on: ubuntu-latest
93+
# if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }}
94+
steps:
95+
- name: checkout
96+
uses: actions/checkout@v2
97+
98+
- uses: actions/setup-node@v2
99+
with:
100+
node-version: '14'
101+
102+
- name: install
103+
run: npm i && npm run setup:skip-build
104+
105+
- name: test code-generator
106+
run: cd modules/code-generator && npm i && npm run build && npm run test:cov && cd ../..
107+
108+
- name: Upload code-generator coverage to Codecov
109+
uses: codecov/codecov-action@v3
110+
with:
111+
# working-directory: packages/designer
112+
directory: ./modules/code-generator/coverage
113+
token: ${{ secrets.CODECOV_TOKEN }}
114+
name: code-generator
115+
fail_ci_if_error: true
116+
verbose: true

modules/code-generator/src/parser/SchemaParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class SchemaParser implements ISchemaParser {
123123
const schema = this.decodeSchema(schemaSrc);
124124

125125
// 解析三方组件依赖
126-
schema.componentsMap.forEach((info) => {
126+
schema.componentsMap.forEach((info: any) => {
127127
if (info.componentName) {
128128
compDeps[info.componentName] = {
129129
...info,

modules/code-generator/src/utils/expressionParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export function parseExpressionGetKeywords(expr: string | null | undefined): str
181181
const fieldValue = node[fieldName as keyof typeof node];
182182
if (typeof fieldValue === 'object') {
183183
if (Array.isArray(fieldValue)) {
184-
fieldValue.forEach((item) => {
184+
fieldValue.forEach((item: any) => {
185185
addIdentifierIfNeeded(item);
186186
});
187187
} else {
@@ -233,7 +233,7 @@ export function parseExpressionGetGlobalVariables(
233233
const fieldValue = node[fieldName as keyof typeof node];
234234
if (typeof fieldValue === 'object') {
235235
if (Array.isArray(fieldValue)) {
236-
fieldValue.forEach((item) => {
236+
fieldValue.forEach((item: any) => {
237237
addUndeclaredIdentifierIfNeeded(item, path);
238238
});
239239
} else {

packages/engine/README-zh_CN.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
1414

15-
[![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
15+
[![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
16+
17+
[![codecov][codecov-image-url]][codecov-url]
1618

1719
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
1820
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
@@ -25,6 +27,9 @@
2527
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
2628
[issues-helper-url]: https://github.com/actions-cool/issues-helper
2729

30+
[codecov-image-url]: https://codecov.io/gh/alibaba/lowcode-engine/branch/main/graph/badge.svg
31+
[codecov-url]: https://codecov.io/gh/alibaba/lowcode-engine
32+
2833
</div>
2934

3035
[![](https://img.alicdn.com/imgextra/i2/O1CN01UhoS7C1sNNhySvfWi_!!6000000005754-2-tps-2878-1588.png)](https://lowcode-engine.cn)

packages/engine/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ An enterprise-class low-code technology stack with scale-out design
1414

1515
[![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
1616

17+
[![codecov][codecov-image-url]][codecov-url]
18+
1719
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
1820
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
1921

@@ -25,6 +27,9 @@ An enterprise-class low-code technology stack with scale-out design
2527
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
2628
[issues-helper-url]: https://github.com/actions-cool/issues-helper
2729

30+
[codecov-image-url]: https://codecov.io/gh/alibaba/lowcode-engine/branch/main/graph/badge.svg
31+
[codecov-url]: https://codecov.io/gh/alibaba/lowcode-engine
32+
2833
</div>
2934

3035
[![](https://img.alicdn.com/imgextra/i2/O1CN01UhoS7C1sNNhySvfWi_!!6000000005754-2-tps-2878-1588.png)](http://lowcode-engine.cn)

packages/react-simulator-renderer/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"scripts": {
1414
"test": "build-scripts test --config build.test.json",
1515
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
16-
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json"
16+
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
17+
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
1718
},
1819
"dependencies": {
1920
"@alilc/lowcode-designer": "1.0.14",

0 commit comments

Comments
 (0)