improved gitlab ci job

This commit is contained in:
lukas 2020-06-20 10:02:03 +02:00
parent 18ce670836
commit ec4e54e991

View File

@ -1,18 +1,31 @@
image: node:latest image: node:latest
stages: stages:
- test - prepare
- coverage
- build - build
- test
cache: cache:
paths: paths:
- node_modules/ - node_modules/
prepare:
stage: prepare
script:
- npm install --progress=false
build:
stage: build
script:
- npm run build
artifacts:
expire_in: 7 days
paths:
- build/
test: test:
stage: test stage: test
script: script:
- npm install
- CI=true npm run test - CI=true npm run test
artifacts: artifacts:
reports: reports:
@ -20,15 +33,10 @@ test:
- ./junit.xml - ./junit.xml
coverage: coverage:
stage: coverage stage: test
script: script:
- CI=true npm run coverage - CI=true npm run coverage
artifacts: artifacts:
reports: reports:
cobertura: cobertura:
- ./coverage/cobertura-coverage.xml - ./coverage/cobertura-coverage.xml
build:
stage: build
script:
- npm run build