From 259b06f87dbeab622fea08419ed7b08d280f365c Mon Sep 17 00:00:00 2001 From: Spencer Ofwiti Date: Wed, 25 Nov 2020 18:01:42 +0300 Subject: [PATCH] Refactor ci pipeline. --- .gitlab-ci.yml | 90 +++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b7da720..fe4e0b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,8 @@ stages: - install - - build_and_test - build - test + - build_and_test variables: PROJECT_PATH: "$CI_PROJECT_DIR" @@ -31,6 +31,50 @@ install_dependencies: changes: - package-lock.json +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 + build_app: stage: build_and_test image: node:15-alpine3.10 @@ -81,47 +125,3 @@ 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