From a5c61e656b48cdd7084098a55330fdfc43966356 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Tue, 14 Jan 2020 16:52:39 -0500 Subject: [PATCH] Adds CI files. Edits project properties --- .sonarcloud.properties | 8 ++++++++ .travis.yml | 20 ++++++++++++++++++++ angular.json | 20 ++++++++++---------- package.json | 12 ++++++++++-- sonar-project.properties | 1 + 5 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 .sonarcloud.properties create mode 100644 .travis.yml create mode 120000 sonar-project.properties diff --git a/.sonarcloud.properties b/.sonarcloud.properties new file mode 100644 index 0000000..2fd3a2e --- /dev/null +++ b/.sonarcloud.properties @@ -0,0 +1,8 @@ +sonar.organization=sartography +sonar.projectKey=sartography_cr-connect-bpmn +sonar.host.url=https://sonarcloud.io +sonar.login=f586bac67c1fe26a18700fa0ecf535e9c8a49bee +sonar.javascript.lcov.reportPaths=coverage/cr-connect-bpmn/lcov.info +sonar.typescript.tsconfigPath=tsconfig.json +sonar.coverage.exclusions=**/*.mocks.ts, **/*.spec.ts, e2e/**, src/app/assets/**, src/main.ts, src/test.ts, src/polyfills.ts, karma.conf.js +sonar.cpd.exclusions=**/*.mocks.ts, **/*.spec.ts, e2e/**, src/app/assets/**, src/main.ts, src/test.ts, src/polyfills.ts, karma.conf.js diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ce9c13b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +sudo: required +dist: trusty +addons: + apt: + sources: + - google-chrome + packages: + - google-chrome-stable + sonarcloud: + organization: "sartography" +language: node_js +node_js: + - 12 +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start +install: + - npm install +script: + - npm run ci diff --git a/angular.json b/angular.json index 3c91949..dac72d0 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "bpmn-js-angular": { + "cr-connect-bpmn": { "root": "", "sourceRoot": "src", "projectType": "application", @@ -13,7 +13,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/bpmn-js-angular", + "outputPath": "dist/cr-connect-bpmn", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", @@ -84,18 +84,18 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "bpmn-js-angular:build" + "browserTarget": "cr-connect-bpmn:build" }, "configurations": { "production": { - "browserTarget": "bpmn-js-angular:build:production" + "browserTarget": "cr-connect-bpmn:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "bpmn-js-angular:build" + "browserTarget": "cr-connect-bpmn:build" } }, "test": { @@ -104,7 +104,7 @@ "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", - "karmaConfig": "src/karma.conf.js", + "karmaConfig": "karma.conf.js", "styles": [ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.css" @@ -136,7 +136,7 @@ } } }, - "bpmn-js-angular-e2e": { + "cr-connect-bpmn-e2e": { "root": "e2e/", "projectType": "application", "prefix": "", @@ -145,11 +145,11 @@ "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "bpmn-js-angular:serve" + "devServerTarget": "cr-connect-bpmn:serve" }, "configurations": { "production": { - "devServerTarget": "bpmn-js-angular:serve:production" + "devServerTarget": "cr-connect-bpmn:serve:production" } } }, @@ -165,7 +165,7 @@ } } }, - "defaultProject": "bpmn-js-angular", + "defaultProject": "cr-connect-bpmn", "schematics": { "@schematics/angular:component": { "style": "scss" diff --git a/package.json b/package.json index 610b68b..546fdd4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "bpmn-js-angular", + "name": "cr-connect-bpmn", "version": "0.0.0", "scripts": { "ng": "ng", @@ -9,8 +9,16 @@ "build:staging": "ng build --configuration=staging", "build:test": "ng build --configuration=test", "test": "ng test", + "test:once": "ng test --code-coverage --watch=false", "lint": "ng lint", - "e2e": "./node_modules/protractor/bin/webdriver-manager update && ng e2e" + "e2e": "ng e2e", + "e2e:with-wf": "npm run wf && ng e2e", + "wf:build": "docker build -t wf github.com/sartography/cr-connect-workflow", + "wf:start": "docker run -d --name wf -p 5000:5000 wf", + "wf:db": "docker exec -it wf sh -c 'pipenv run flask db upgrade'", + "wf:data": "docker exec -it wf sh -c 'pipenv run flask load-example-data'", + "wf": "npm run wf:build && npm run wf:start && npm run wf:db && npm run wf:data", + "ci": "npm run lint && npm run test:once && npm run e2e:with-wf && sonar-scanner" }, "private": true, "dependencies": { diff --git a/sonar-project.properties b/sonar-project.properties new file mode 120000 index 0000000..56b26ee --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +.sonarcloud.properties \ No newline at end of file