diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60ce80f45bc22417ea997a1d70086d9d31484474..c8b8d60e6e776952ff67fa7127eca97538693620 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,41 +1,22 @@ default: image: node:16.16.0 -variables: - # enable docker buildkit. Used with `BUILDKIT_INLINE_CACHE=1` below - DOCKER_BUILDKIT: 1 - DOCKER_TLS_CERTDIR: '/certs' - IMAGE_TEST: $CI_REGISTRY_IMAGE/test:latest - #IMAGE_CYPRESS: $CI_REGISTRY_IMAGE/cypress:latest - IMAGE_DEPLOY: $CI_REGISTRY_IMAGE/deploy:latest - stages: - - build - - misc - - deploy + - test cache: paths: - ~/.cache -.base: - image: docker:latest - services: - - docker:dind +jest: + stage: test before_script: - - docker --version - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" - -build:builder: - extends: .base - stage: build - script: - - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_TEST" --target builder -t "$IMAGE_TEST" . - - docker push "$IMAGE_TEST" - -build:deployimage: - extends: .base - stage: misc - needs: ['build:builder'] + - apk add --no-cache npm + - npm ci script: - - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_DEPLOY" --cache-from "$IMAGE_TEST" --cache-from "$IMAGE_CYPRESS" -t "$IMAGE_DEPLOY" . - - docker push "$IMAGE_DEPLOY" + - npm run test:ci + only: + - master + - merge_requests + - tags + tags: + - k8s diff --git a/package.json b/package.json index f86a99a4a72f4dbd541fa27f7574cadefbea83b9..6318e726c431c591b3ea4750c8ce1486e477c190 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "prepare": "husky install", "postinstall": "husky install", "test": "jest --watch --config ./jest.config.mjs", + "test:ci": "jest --coverage --config ./config/jest.config.js", "test:coverage": "jest --watchAll --coverage --config ./jest.config.mjs", "test:coveragee": "jest --coverage", "coverage": "open ./coverage/lcov-report/index.html"