chore: added codecov with ci git action

This commit is contained in:
liujuping 2022-09-15 15:14:52 +08:00 committed by LeoYuan 袁力皓
parent d1c9838343
commit eb73686c24
6 changed files with 132 additions and 5 deletions

116
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,116 @@
name: Node CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
upload-designer-codecov:
runs-on: ubuntu-latest
# if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }}
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install
run: npm i && npm run setup:skip-build
- name: test designer
run: cd packages/designer && npm run test:cov && cd ../..
- name: Upload designer coverage to Codecov
uses: codecov/codecov-action@v3
with:
# working-directory: packages/designer
directory: ./packages/designer/coverage
token: ${{ secrets.CODECOV_TOKEN }}
name: designer
fail_ci_if_error: true
verbose: true
upload-renderer-core:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install
run: npm i && npm run setup:skip-build
- name: test renderer-core
run: cd packages/renderer-core && npm run test:cov && cd ../..
- name: Upload renderer-core coverage to Codecov
uses: codecov/codecov-action@v3
with:
# working-directory: packages/designer
directory: ./packages/renderer-core/coverage
token: ${{ secrets.CODECOV_TOKEN }}
name: renderer-core
fail_ci_if_error: true
verbose: true
upload-react-simulator-renderer:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install
run: npm i && npm run setup:skip-build
- name: test react-simulator-renderer
run: cd packages/react-simulator-renderer && npm run test:cov && cd ../..
- name: Upload react-simulator-renderer coverage to Codecov
uses: codecov/codecov-action@v3
with:
# working-directory: packages/designer
directory: ./packages/react-simulator-renderer/coverage
token: ${{ secrets.CODECOV_TOKEN }}
name: react-simulator-renderer
fail_ci_if_error: true
verbose: true
upload-code-generator:
runs-on: ubuntu-latest
# if: ${{ github.event.pull_request.head.repo.full_name == 'alibaba/lowcode-engine' }}
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install
run: npm i && npm run setup:skip-build
- name: test code-generator
run: cd modules/code-generator && npm i && npm run build && npm run test:cov && cd ../..
- name: Upload code-generator coverage to Codecov
uses: codecov/codecov-action@v3
with:
# working-directory: packages/designer
directory: ./modules/code-generator/coverage
token: ${{ secrets.CODECOV_TOKEN }}
name: code-generator
fail_ci_if_error: true
verbose: true

View File

@ -123,7 +123,7 @@ export class SchemaParser implements ISchemaParser {
const schema = this.decodeSchema(schemaSrc);
// 解析三方组件依赖
schema.componentsMap.forEach((info) => {
schema.componentsMap.forEach((info: any) => {
if (info.componentName) {
compDeps[info.componentName] = {
...info,

View File

@ -181,7 +181,7 @@ export function parseExpressionGetKeywords(expr: string | null | undefined): str
const fieldValue = node[fieldName as keyof typeof node];
if (typeof fieldValue === 'object') {
if (Array.isArray(fieldValue)) {
fieldValue.forEach((item) => {
fieldValue.forEach((item: any) => {
addIdentifierIfNeeded(item);
});
} else {
@ -233,7 +233,7 @@ export function parseExpressionGetGlobalVariables(
const fieldValue = node[fieldName as keyof typeof node];
if (typeof fieldValue === 'object') {
if (Array.isArray(fieldValue)) {
fieldValue.forEach((item) => {
fieldValue.forEach((item: any) => {
addUndeclaredIdentifierIfNeeded(item, path);
});
} else {

View File

@ -12,7 +12,9 @@
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
[![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[![codecov][codecov-image-url]][codecov-url]
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
@ -25,6 +27,9 @@
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
[issues-helper-url]: https://github.com/actions-cool/issues-helper
[codecov-image-url]: https://codecov.io/gh/alibaba/lowcode-engine/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/alibaba/lowcode-engine
</div>
[![](https://img.alicdn.com/imgextra/i2/O1CN01UhoS7C1sNNhySvfWi_!!6000000005754-2-tps-2878-1588.png)](https://lowcode-engine.cn)

View File

@ -14,6 +14,8 @@ An enterprise-class low-code technology stack with scale-out design
[![][issues-helper-image]][issues-helper-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[![codecov][codecov-image-url]][codecov-url]
[npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square
[npm-url]: http://npmjs.org/package/@alilc/lowcode-engine
@ -25,6 +27,9 @@ An enterprise-class low-code technology stack with scale-out design
[issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square
[issues-helper-url]: https://github.com/actions-cool/issues-helper
[codecov-image-url]: https://codecov.io/gh/alibaba/lowcode-engine/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/alibaba/lowcode-engine
</div>
[![](https://img.alicdn.com/imgextra/i2/O1CN01UhoS7C1sNNhySvfWi_!!6000000005754-2-tps-2878-1588.png)](http://lowcode-engine.cn)

View File

@ -13,7 +13,8 @@
"scripts": {
"test": "build-scripts test --config build.test.json",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json"
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
"dependencies": {
"@alilc/lowcode-designer": "1.0.14",