* Create node.js.yml

* fix: npm install command

* fix: try to fix github action fail by use same react version

* fix: try to fix github action fail by use same react version

* fix: try to fix github action fail by use same react version

* fix: try to fix github action fail by use same react version

* fix: try to fix github action fail by build dependencies

* fix: try to fix ci fail by types resolution

* fix: try to fix ci fail by types resolution

* fix: try to fix ci fail by types resolution

* fix: try to fix ci fail by types resolution

* fix: try to fix ci fail by types resolution

* fix: try to fix ci fail by set env

* fix: try to fix ci fail by pg version

* fix: try to fix ci fail by fix types

* fix(test): Type '""' is not assignable to type 'IndexType'.

* fix(test): Type '""' is not assignable to type 'IndexType'

Co-authored-by: Junyi <mytharcher@users.noreply.github.com>
Co-authored-by: mytharcher <mytharcher@gmail.com>
This commit is contained in:
chenos 2020-12-05 09:27:24 +08:00 committed by GitHub
parent 3e3cb416b6
commit 0a0d09119b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 14 deletions

View File

@ -8,6 +8,7 @@ const headPkgs = [
'resourcer', 'resourcer',
'actions', 'actions',
'client', 'client',
'server'
]; ];
const tailPkgs = []; const tailPkgs = [];
const otherPkgs = readdirSync(join(__dirname, 'packages')).filter( const otherPkgs = readdirSync(join(__dirname, 'packages')).filter(

47
.github/workflows/node.js.yml vendored Normal file
View File

@ -0,0 +1,47 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on: [push]
jobs:
test:
strategy:
matrix:
node_version: ['12']
db_dialect: ['postgres']
pg_version: ['12']
runs-on: ubuntu-latest
container: node:${{ matrix.node_version }}
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:${{ matrix.pg_version }}
# Provide the password for postgres
env:
POSTGRES_USER: nocobase
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- run: npm i
- run: npm run bootstrap
- run: npm run build
- name: Test
run: npm test
env:
DB_DIALECT: ${{ matrix.db_dialect }}
DB_HOST: ${{ matrix.db_dialect }}
DB_PORT: 5432
DB_USER: nocobase
DB_PASSWORD: password
DB_DATABASE: nocobase

View File

@ -22,7 +22,7 @@
"@types/koa__router": "^8.0.2", "@types/koa__router": "^8.0.2",
"@types/lodash": "^4.14.158", "@types/lodash": "^4.14.158",
"@types/node": "^14.0.23", "@types/node": "^14.0.23",
"@types/react": "^16.9.53", "@types/react": "16.14.0",
"@types/supertest": "^2.0.10", "@types/supertest": "^2.0.10",
"@typescript-eslint/eslint-plugin": "^3.6.1", "@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1", "@typescript-eslint/parser": "^3.6.1",

View File

@ -38,8 +38,8 @@
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",
"nodemon": "^2.0.6", "nodemon": "^2.0.6",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"react": "^16.12.0", "react": "16.14.0",
"react-dom": "^16.12.0", "react-dom": "16.14.0",
"react-sortable-hoc": "^1.11.0", "react-sortable-hoc": "^1.11.0",
"styled-components": "^5.2.1", "styled-components": "^5.2.1",
"umi": "^3.2.23", "umi": "^3.2.23",

View File

@ -3,11 +3,15 @@
"version": "0.3.0-alpha.0", "version": "0.3.0-alpha.0",
"main": "lib/index.js", "main": "lib/index.js",
"license": "MIT", "license": "MIT",
"resolutions": {
"@types/react": "16.14.0"
},
"dependencies": { "dependencies": {
"@ant-design/icons": "^4.2.2", "@ant-design/icons": "^4.2.2",
"@types/react": "16.14.0",
"ahooks": "^2.7.1", "ahooks": "^2.7.1",
"antd": "^4.7.3", "antd": "^4.7.3",
"react": "^16.12.0", "react": "16.14.0",
"umi": "^3.2.24", "umi": "^3.2.24",
"umi-request": "^1.3.5" "umi-request": "^1.3.5"
} }

View File

@ -94,9 +94,10 @@ describe('tables', () => {
], ],
}); });
expect(db.getModel('baz').options.indexes).toStrictEqual(db.getTable('baz').getModelOptions().indexes); expect(db.getModel('baz').options.indexes).toStrictEqual(db.getTable('baz').getModelOptions().indexes);
expect(db.getTable('baz').getModelOptions().indexes).toStrictEqual([ // @ts-ignore
{ fields: [ 'col1' ], name: 'baz_col1', type: '', parser: null }, expect(db.getTable('baz').getModelOptions().indexes).toMatchObject([
{ fields: [ 'col2', 'col3' ], name: 'baz_col2_col3', type: '', parser: null } { fields: [ 'col1' ], name: 'baz_col1', parser: null },
{ fields: [ 'col2', 'col3' ], name: 'baz_col2_col3', parser: null }
]); ]);
}); });
@ -127,9 +128,10 @@ describe('tables', () => {
], ],
}); });
expect(db.getModel('baz2').options.indexes).toStrictEqual(db.getTable('baz2').getModelOptions().indexes); expect(db.getModel('baz2').options.indexes).toStrictEqual(db.getTable('baz2').getModelOptions().indexes);
expect(db.getTable('baz2').getModelOptions().indexes).toStrictEqual([ // @ts-ignore
{ fields: [ 'col1' ], name: 'baz2_col1', type: '', parser: null }, expect(db.getTable('baz2').getModelOptions().indexes).toMatchObject([
{ fields: [ 'col2', 'col3' ], name: 'baz2_col2_col3', type: '', parser: null }, { fields: [ 'col1' ], name: 'baz2_col1', parser: null },
{ fields: [ 'col2', 'col3' ], name: 'baz2_col2_col3', parser: null },
]); ]);
}); });
}); });

View File

@ -1,5 +1,5 @@
{ {
"dependencies": { "dependencies": {
"react": "^16.8.4" "react": "16"
} }
} }

View File

@ -8,6 +8,6 @@
"@nocobase/database": "^0.3.0-alpha.0", "@nocobase/database": "^0.3.0-alpha.0",
"@nocobase/resourcer": "^0.3.0-alpha.0", "@nocobase/resourcer": "^0.3.0-alpha.0",
"@nocobase/client": "^0.3.0-alpha.0", "@nocobase/client": "^0.3.0-alpha.0",
"react": "^16.12.0" "react": "16.14.0"
} }
} }

View File

@ -3,6 +3,9 @@
"version": "0.3.0-alpha.0", "version": "0.3.0-alpha.0",
"main": "lib/index.js", "main": "lib/index.js",
"license": "MIT", "license": "MIT",
"resolutions": {
"@types/react": "16.14.0"
},
"peerDependencies": { "peerDependencies": {
"umi": "^3.2.23" "umi": "^3.2.23"
}, },
@ -14,6 +17,7 @@
"dependencies": { "dependencies": {
"@nocobase/client": "^0.3.0-alpha.0", "@nocobase/client": "^0.3.0-alpha.0",
"@nocobase/database": "^0.3.0-alpha.0", "@nocobase/database": "^0.3.0-alpha.0",
"@nocobase/resourcer": "^0.3.0-alpha.0" "@nocobase/resourcer": "^0.3.0-alpha.0",
"@types/react": "16.14.0"
} }
} }