Explorar o código

chore: Add admin-ui prod build to CI scripts

Michael Bromley %!s(int64=7) %!d(string=hai) anos
pai
achega
901d1e0a68

+ 6 - 1
.travis.yml

@@ -1,6 +1,9 @@
 dist: trusty
 sudo: false
 
+git:
+  depth: 3
+
 language: node_js
 node_js:
   - "9"
@@ -11,4 +14,6 @@ install:
   - yarn install
 
 script:
-  - yarn test
+  - cd admin-ui && yarn test --watch=false --browsers=ChromeHeadlessCI --progress=false
+  - cd ../server && yarn test
+  - cd admin-ui && yarn build --prod

+ 2 - 2
admin-ui/src/app/shared/components/modal-dialog/modal-dialog.component.html

@@ -1,7 +1,7 @@
 <clr-modal [clrModalOpen]="true"
            (clrModalOpenChange)="modalOpenChange($event)"
-           [clrModalClosable]="options.closable"
-           [clrModalSize]="options.size">
+           [clrModalClosable]="options?.closable"
+           [clrModalSize]="options?.size">
     <h3 class="modal-title">
         <ng-container *ngTemplateOutlet="titleTemplateRef$ | async"></ng-container>
     </h3>

+ 7 - 1
admin-ui/src/testing/translate.pipe.mock.ts

@@ -1,4 +1,4 @@
-import { Pipe, PipeTransform } from '@angular/core';
+import { NgModule, Pipe, PipeTransform } from '@angular/core';
 
 @Pipe({
     name: 'translate',
@@ -8,3 +8,9 @@ export class MockTranslatePipe implements PipeTransform {
         return value;
     }
 }
+
+// Work around for https://github.com/angular/angular/issues/13590
+@NgModule({
+    declarations: [MockTranslatePipe],
+})
+export class MockTranslatePipeModule {}

+ 2 - 1
package.json

@@ -8,7 +8,8 @@
     "lint:server": "cd server && yarn lint --fix",
     "lint:admin-ui": "cd admin-ui && yarn lint --fix",
     "precommit": "lint-staged",
-    "postcommit": "git update-index --again"
+    "postcommit": "git update-index --again",
+    "prepush": "yarn test && cd admin-ui && yarn build --prod"
   },
   "devDependencies": {
     "husky": "^0.14.3",