Refactor ci pipeline.

This commit is contained in:
Spencer Ofwiti 2020-11-25 18:01:42 +03:00
parent 0745c3089d
commit 259b06f87d
1 changed files with 45 additions and 45 deletions

View File

@ -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