Test/ci (#31)
* 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:
parent
3e3cb416b6
commit
0a0d09119b
@ -8,6 +8,7 @@ const headPkgs = [
|
||||
'resourcer',
|
||||
'actions',
|
||||
'client',
|
||||
'server'
|
||||
];
|
||||
const tailPkgs = [];
|
||||
const otherPkgs = readdirSync(join(__dirname, 'packages')).filter(
|
||||
|
47
.github/workflows/node.js.yml
vendored
Normal file
47
.github/workflows/node.js.yml
vendored
Normal 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
|
@ -22,7 +22,7 @@
|
||||
"@types/koa__router": "^8.0.2",
|
||||
"@types/lodash": "^4.14.158",
|
||||
"@types/node": "^14.0.23",
|
||||
"@types/react": "^16.9.53",
|
||||
"@types/react": "16.14.0",
|
||||
"@types/supertest": "^2.0.10",
|
||||
"@typescript-eslint/eslint-plugin": "^3.6.1",
|
||||
"@typescript-eslint/parser": "^3.6.1",
|
||||
|
@ -38,8 +38,8 @@
|
||||
"lint-staged": "^10.0.7",
|
||||
"nodemon": "^2.0.6",
|
||||
"prettier": "^1.19.1",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0",
|
||||
"react-sortable-hoc": "^1.11.0",
|
||||
"styled-components": "^5.2.1",
|
||||
"umi": "^3.2.23",
|
||||
|
@ -3,11 +3,15 @@
|
||||
"version": "0.3.0-alpha.0",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
"resolutions": {
|
||||
"@types/react": "16.14.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^4.2.2",
|
||||
"@ant-design/icons": "^4.2.2",
|
||||
"@types/react": "16.14.0",
|
||||
"ahooks": "^2.7.1",
|
||||
"antd": "^4.7.3",
|
||||
"react": "^16.12.0",
|
||||
"react": "16.14.0",
|
||||
"umi": "^3.2.24",
|
||||
"umi-request": "^1.3.5"
|
||||
}
|
||||
|
@ -94,9 +94,10 @@ describe('tables', () => {
|
||||
],
|
||||
});
|
||||
expect(db.getModel('baz').options.indexes).toStrictEqual(db.getTable('baz').getModelOptions().indexes);
|
||||
expect(db.getTable('baz').getModelOptions().indexes).toStrictEqual([
|
||||
{ fields: [ 'col1' ], name: 'baz_col1', type: '', parser: null },
|
||||
{ fields: [ 'col2', 'col3' ], name: 'baz_col2_col3', type: '', parser: null }
|
||||
// @ts-ignore
|
||||
expect(db.getTable('baz').getModelOptions().indexes).toMatchObject([
|
||||
{ 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.getTable('baz2').getModelOptions().indexes).toStrictEqual([
|
||||
{ fields: [ 'col1' ], name: 'baz2_col1', type: '', parser: null },
|
||||
{ fields: [ 'col2', 'col3' ], name: 'baz2_col2_col3', type: '', parser: null },
|
||||
// @ts-ignore
|
||||
expect(db.getTable('baz2').getModelOptions().indexes).toMatchObject([
|
||||
{ fields: [ 'col1' ], name: 'baz2_col1', parser: null },
|
||||
{ fields: [ 'col2', 'col3' ], name: 'baz2_col2_col3', parser: null },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"react": "^16.8.4"
|
||||
"react": "16"
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,6 @@
|
||||
"@nocobase/database": "^0.3.0-alpha.0",
|
||||
"@nocobase/resourcer": "^0.3.0-alpha.0",
|
||||
"@nocobase/client": "^0.3.0-alpha.0",
|
||||
"react": "^16.12.0"
|
||||
"react": "16.14.0"
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,9 @@
|
||||
"version": "0.3.0-alpha.0",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
"resolutions": {
|
||||
"@types/react": "16.14.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"umi": "^3.2.23"
|
||||
},
|
||||
@ -14,6 +17,7 @@
|
||||
"dependencies": {
|
||||
"@nocobase/client": "^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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user