|
|
@@ -1,39 +1,39 @@
|
|
|
stages:
|
|
|
+ - build
|
|
|
- test
|
|
|
- - qa
|
|
|
+ - analysis
|
|
|
|
|
|
variables:
|
|
|
APP_ENV: ci
|
|
|
|
|
|
-before_script:
|
|
|
- - echo "" > ./env/local.app.opentalent.fr.crt
|
|
|
- - echo "" > ./env/local.app.opentalent.fr.key
|
|
|
- - corepack enable
|
|
|
- - yarn set version berry
|
|
|
- - yarn install --network-timeout 10000
|
|
|
- - HOSTNAME=ci yarn prepare
|
|
|
-
|
|
|
cache:
|
|
|
paths:
|
|
|
- ./node_modules
|
|
|
- .yarn
|
|
|
+ - yarn.lock
|
|
|
|
|
|
-code_quality:
|
|
|
- stage: qa
|
|
|
+build_image:
|
|
|
+ stage: build
|
|
|
+ image: docker:20.10
|
|
|
+ before_script:
|
|
|
+ - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
|
script:
|
|
|
- - yarn eslint
|
|
|
+ - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
|
|
|
+ - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
|
|
|
+ - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
|
+ - docker push $CI_REGISTRY_IMAGE:latest
|
|
|
|
|
|
-code_style:
|
|
|
- stage: qa
|
|
|
- script:
|
|
|
- - yarn prettier . --check
|
|
|
+.default_config: &default_config
|
|
|
+ image: $CI_REGISTRY_IMAGE:latest
|
|
|
+ before_script:
|
|
|
+ - yarn install --network-timeout 10000
|
|
|
+ - HOSTNAME=ci yarn prepare
|
|
|
|
|
|
unit:
|
|
|
+ <<: *default_config
|
|
|
stage: test
|
|
|
-
|
|
|
script:
|
|
|
- yarn test
|
|
|
-
|
|
|
artifacts:
|
|
|
paths:
|
|
|
- ./coverage/
|
|
|
@@ -46,3 +46,15 @@ unit:
|
|
|
|
|
|
# Extract total coverage from job logs (https://docs.gitlab.com/15.6/ee/ci/yaml/index.html#coverage)
|
|
|
coverage: '/All files\s*|\s*\d+\.\d+/'
|
|
|
+
|
|
|
+code_quality:
|
|
|
+ <<: *default_config
|
|
|
+ stage: analysis
|
|
|
+ script:
|
|
|
+ - yarn eslint
|
|
|
+
|
|
|
+code_style:
|
|
|
+ <<: *default_config
|
|
|
+ stage: analysis
|
|
|
+ script:
|
|
|
+ - yarn prettier . --check
|