Merge branch 'build' into 'dev'

ci: integrate with gitlab-ci

See merge request dt-insight-front/infrastructure/dt-sql-parser!7
This commit is contained in:
zhifei 2020-12-30 10:01:55 +08:00
commit a059f79585
5 changed files with 49 additions and 6 deletions

45
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,45 @@
# Read more: https://docs.gitlab.com/12.7/ee/ci/yaml/README.html
cache:
paths:
- .yarn
- node_modules/
before_script:
- yarn install --cache-folder .yarn
stages:
- static-checking
- type-checking
- test
- build
static-checking:
stage: static-checking
script:
- yarn eslint
only:
- merge_requests
- dev
type-checking:
stage: type-checking
script:
- yarn check-types
only:
- merge_requests
- dev
test:
stage: test
script:
- yarn test
only:
- merge_requests
- dev
build:
stage: build
script:
- yarn build
only:
- dev

View File

@ -15,10 +15,10 @@
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"antlr4": "node build/antlr4.js", "antlr4": "node build/antlr4.js",
"build": "npm test && rm -rf dist && tsc", "build": "rm -rf dist && tsc",
"eslint": "eslint ./src/**/*.ts", "eslint": "eslint ./src/**/*.ts",
"check-types": "tsc --skipLibCheck", "check-types": "tsc --skipLibCheck",
"test": "jest --coverage" "test": "jest"
}, },
"author": "dt-insight-front", "author": "dt-insight-front",
"license": "ISC", "license": "ISC",

View File

@ -10,6 +10,7 @@ describe('PLSQL Listener Tests', () => {
test('Listener enterTableName', async () => { test('Listener enterTableName', async () => {
let result = ''; let result = '';
class MyListener extends PlSqlParserListener { class MyListener extends PlSqlParserListener {
// eslint-disable-next-line camelcase
enterTable_ref_list(ctx): void { enterTable_ref_list(ctx): void {
result = ctx.getText().toLowerCase(); result = ctx.getText().toLowerCase();
} }

View File

@ -10,6 +10,7 @@ describe('PLSQL Visitor Tests', () => {
test('Visitor visitTable_ref_list', () => { test('Visitor visitTable_ref_list', () => {
let result = ''; let result = '';
class MyVisitor extends PlSqlParserVisitor { class MyVisitor extends PlSqlParserVisitor {
// eslint-disable-next-line camelcase
visitTable_ref_list(ctx): void { visitTable_ref_list(ctx): void {
result = ctx.getText().toLowerCase(); result = ctx.getText().toLowerCase();
super.visitTable_ref_list(ctx); super.visitTable_ref_list(ctx);

View File

@ -17,10 +17,6 @@
"include": [ "include": [
"./src/**/*" "./src/**/*"
], ],
"exclude": [
"./src/peg/*",
"./src/jison/*"
],
"typeAcquisition": { "typeAcquisition": {
"include": [ "include": [
"jest" "jest"