diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e766a7f..b7da720 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,14 @@ stages: - install - build_and_test + - build + - test variables: PROJECT_PATH: "$CI_PROJECT_DIR" - APP_OUTPUT_PATH: "$CI_PROJECT_DIR/artifacts/app" - OUTPUT_PATH: "$CI_PROJECT_DIR/artifacts" + APP_OUTPUT_PATH: "$CI_PROJECT_DIR/dist/cic-staff-client" + OUTPUT_PATH: "$CI_PROJECT_DIR/dist" + CLI_VERSION: 10.2.0 install_dependencies: stage: install @@ -41,6 +44,7 @@ build_app: - cp $PROJECT_PATH/Dockerfile $APP_OUTPUT_PATH artifacts: name: "cic-staff-client-pipeline" + expire_in: 30 days paths: - $APP_OUTPUT_PATH cache: @@ -77,3 +81,47 @@ test_app: paths: - node_modules policy: pull + +build: + stage: build + image: trion/ng-cli + tags: + - docker + before_script: + - npm ci + script: + - ng build --prod + artifacts: + expire_in: 1 days + paths: + - dist/cic-staff-client + +test:karma: + stage: test + image: trion/ng-cli-karma:$(CLI_VERSION) + allow_failure: false + tags: + - docker + script: + - ng test --code-coverage --progress false --watch false + coverage: '/Lines \W+: (\d+\.\d+)%.*/' + artifacts: + paths: + - coverage/ + +test:e2e: + stage: test + image: trion/ng-cli-e2e:$(CLI_VERSION) + allow_failure: false + tags: + - docker + script: + - ng e2e + +test:nglint: + stage: test + image: trion/ng-cli:$(CLI_VERSION) + tags: + - docker + script: + - ng lint diff --git a/angular.json b/angular.json index b26b15f..3a0243d 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "artifacts/app", + "outputPath": "dist/cic-staff-client", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", diff --git a/karma.conf.js b/karma.conf.js index 03148c5..5eed447 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -17,7 +17,7 @@ module.exports = function (config) { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { - dir: require('path').join(__dirname, './artifacts/coverage'), + dir: require('path').join(__dirname, './coverage/cic-staff-client'), reports: ['html', 'lcovonly', 'text-summary', 'cobertura'], fixWebpackSourcePaths: true, 'report-config': { @@ -27,7 +27,7 @@ module.exports = function (config) { }, }, junitReporter: { - outputDir: 'artifacts/tests', + outputDir: require('path').join(__dirname, './tests/cic-staff-client'), outputFile: 'junit-test-results.xml', useBrowserName: false },