summaryrefslogtreecommitdiff
path: root/.gitlab/ci/frontend.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci/frontend.gitlab-ci.yml')
-rw-r--r--.gitlab/ci/frontend.gitlab-ci.yml89
1 files changed, 61 insertions, 28 deletions
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml
index 2b22162b0c2..6e9119f295a 100644
--- a/.gitlab/ci/frontend.gitlab-ci.yml
+++ b/.gitlab/ci/frontend.gitlab-ci.yml
@@ -15,8 +15,7 @@
- .default-retry
- .default-before_script
- .assets-compile-cache
- - .use-docker-in-docker
- image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1
+ image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1
stage: prepare
variables:
NODE_ENV: "production"
@@ -34,20 +33,16 @@
paths:
- webpack-report/
- assets-compile.log
- # We consume these files in GitLab UI for integration tests:
- # https://gitlab.com/gitlab-org/gitlab-ui/-/blob/e88493b3c855aea30bf60baee692a64606b0eb1e/.storybook/preview-head.pug#L1
- - public/assets/application-*.css
- - public/assets/application-*.css.gz
+ # These assets are used in multiple locations:
+ # - in `build-assets-image` job to create assets image for packaging systems
+ # - GitLab UI for integration tests: https://gitlab.com/gitlab-org/gitlab-ui/-/blob/e88493b3c855aea30bf60baee692a64606b0eb1e/.storybook/preview-head.pug#L1
+ - public/assets
when: always
script:
- node --version
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline
- free -m
- time bin/rake gitlab:assets:compile > assets-compile.log 2>&1
- # TODO: Change the image tag to be the MD5 of assets files and skip image building if the image exists
- # We'll also need to pass GITLAB_ASSETS_TAG to the trigerred omnibus-gitlab pipeline similarly to how we do it for trigerred CNG pipelines
- # https://gitlab.com/gitlab-org/gitlab/issues/208389
- - time scripts/build_assets_image
- scripts/clean-old-cached-assets
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
@@ -65,6 +60,20 @@ gitlab:assets:compile pull-cache:
cache:
policy: pull
+build-assets-image:
+ extends:
+ - .use-kaniko
+ - .frontend:rules:gitlab-assets-compile-pull-cache
+ stage: build-images
+ needs: ["gitlab:assets:compile pull-cache"]
+ variables:
+ GIT_DEPTH: "1"
+ script:
+ # TODO: Change the image tag to be the MD5 of assets files and skip image building if the image exists
+ # We'll also need to pass GITLAB_ASSETS_TAG to the trigerred omnibus-gitlab pipeline similarly to how we do it for trigerred CNG pipelines
+ # https://gitlab.com/gitlab-org/gitlab/issues/208389
+ - scripts/build_assets_image
+
.compile-assets-metadata:
extends:
- .default-retry
@@ -127,16 +136,15 @@ compile-assets pull-cache as-if-foss:
.frontend-fixtures-base:
extends:
- .default-retry
- - .default-cache
+ - .rails-cache
- .default-before_script
- .use-pg11
stage: fixtures
- needs: ["setup-test-env pg11", "compile-assets pull-cache"]
+ needs: ["setup-test-env", "compile-assets pull-cache"]
script:
- - date
- - scripts/gitaly-test-spawn
- - date
- - bundle exec rake frontend:fixtures
+ - run_timed_command "scripts/gitaly-test-build"
+ - run_timed_command "scripts/gitaly-test-spawn"
+ - run_timed_command "bundle exec rake frontend:fixtures"
artifacts:
name: frontend-fixtures
expire_in: 31d
@@ -154,7 +162,7 @@ frontend-fixtures:
frontend-fixtures-as-if-foss:
extends:
- .frontend-fixtures-base
- - .frontend:rules:default-frontend-jobs-no-foss
+ - .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
.frontend-job-base:
@@ -197,7 +205,7 @@ karma:
karma-as-if-foss:
extends:
- .karma-base
- - .frontend:rules:default-frontend-jobs-no-foss
+ - .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
needs: ["frontend-fixtures-as-if-foss"]
@@ -229,10 +237,24 @@ jest:
junit: junit_jest.xml
parallel: 2
+jest-integration:
+ extends:
+ - .frontend-job-base
+ - .frontend:rules:default-frontend-jobs
+ script:
+ - date
+ - yarn jest:integration --ci
+ needs: ["frontend-fixtures"]
+ cache:
+ key: jest-integration
+ paths:
+ - tmp/cache/jest/
+ policy: pull-push
+
jest-as-if-foss:
extends:
- .jest-base
- - .frontend:rules:default-frontend-jobs-no-foss
+ - .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
needs: ["frontend-fixtures-as-if-foss"]
cache:
@@ -241,11 +263,13 @@ jest-as-if-foss:
coverage-frontend:
extends:
- .default-retry
- - .frontend:rules:default-frontend-jobs-no-foss
+ - .yarn-cache
+ - .frontend:rules:ee-mr-and-master-only
needs: ["jest"]
stage: post-test
before_script:
- - yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
+ - source scripts/utils.sh
+ - retry yarn install --frozen-lockfile
script:
- yarn node scripts/frontend/merge_coverage_frontend.js
artifacts:
@@ -254,8 +278,7 @@ coverage-frontend:
paths:
- coverage-frontend/
cache:
- paths:
- - .yarn-cache/
+ policy: pull
.qa-frontend-node:
extends:
@@ -279,22 +302,32 @@ qa-frontend-node:10:
image: node:dubnium
qa-frontend-node:latest:
- extends: .qa-frontend-node
+ extends:
+ - .qa-frontend-node
+ - .frontend:rules:qa-frontend-node-latest
image: node:latest
- allow_failure: true
webpack-dev-server:
extends:
- .default-retry
- - .default-cache
- .frontend:rules:default-frontend-jobs
stage: test
- needs: ["setup-test-env pg11", "compile-assets pull-cache"]
+ needs: []
variables:
WEBPACK_MEMORY_TEST: "true"
WEBPACK_VENDOR_DLL: "true"
+ cache:
+ key:
+ files:
+ - yarn.lock
+ prefix: "v1"
+ paths:
+ - node_modules/
+ - tmp/cache/webpack-dlls/
script:
- - yarn webpack-vendor
+ - source scripts/utils.sh
+ - retry yarn install --frozen-lockfile
+ - retry yarn webpack-vendor
- node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js
artifacts:
name: webpack-dev-server