gitlab-org--gitlab-foss/.gitlab/ci/frontend.gitlab-ci.yml

259 lines
5.8 KiB
YAML
Raw Normal View History

.assets-compile-cache:
2019-04-12 04:56:38 -04:00
cache:
paths:
- vendor/ruby/
- .yarn-cache/
- tmp/cache/assets/sprockets
.gitlab:assets:compile-metadata:
extends:
- .default-tags
- .default-retry
- .default-only
- .default-before_script
- .assets-compile-cache
- .only-code-qa-changes
image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-git-2.22-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-18.06.1
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
2019-04-12 04:56:38 -04:00
services:
- docker:19.03.0-dind
2019-04-12 04:56:38 -04:00
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
SETUP_DB: "false"
SKIP_STORAGE_VALIDATION: "true"
WEBPACK_REPORT: "true"
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
cache:
key: "assets-compile:production:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v6"
artifacts:
name: webpack-report
expire_in: 31d
paths:
- webpack-report/
- public/assets/
2019-04-12 04:56:38 -04:00
script:
- node --version
2019-07-02 10:29:47 -04:00
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline
2019-04-12 04:56:38 -04:00
- free -m
- retry bundle exec rake gitlab:assets:compile
2019-04-12 04:56:38 -04:00
- 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
2019-04-12 04:56:38 -04:00
only:
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ # Matches the gitlab-org group and its subgroups
- $CI_SERVER_HOST == "dev.gitlab.org"
2019-04-12 04:56:38 -04:00
tags:
- gitlab-org
- docker
2019-04-12 04:56:38 -04:00
gitlab:assets:compile:
extends: .gitlab:assets:compile-metadata
only:
refs:
- master
cache:
policy: pull-push
gitlab:assets:compile pull-cache:
extends: .gitlab:assets:compile-metadata
except:
refs:
- master
cache:
policy: pull
.compile-assets-metadata:
extends:
- .default-tags
- .default-retry
- .default-only
- .default-before_script
- .assets-compile-cache
- .only-code-qa-changes
- .use-pg9
2019-04-12 04:56:38 -04:00
stage: prepare
script:
- node --version
2019-07-02 10:29:47 -04:00
- retry yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
2019-04-12 04:56:38 -04:00
- free -m
- retry bundle exec rake gitlab:assets:compile
2019-04-12 04:56:38 -04:00
- scripts/clean-old-cached-assets
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
cache:
key: "assets-compile:test:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v6"
2019-04-12 04:56:38 -04:00
artifacts:
expire_in: 7d
paths:
- node_modules
- public/assets
compile-assets:
extends: .compile-assets-metadata
only:
refs:
- master
cache:
policy: pull-push
compile-assets pull-cache:
extends: .compile-assets-metadata
2019-04-12 04:56:38 -04:00
except:
refs:
- master
cache:
policy: pull
2019-04-12 04:56:38 -04:00
.only-code-frontend-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .only-code-changes
- .use-pg9
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"]
.karma-base:
extends: .only-code-frontend-job-base
2019-04-12 04:56:38 -04:00
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
script:
- export BABEL_ENV=coverage CHROME_LOG_FILE=chrome_debug.log
- date
- scripts/gitaly-test-spawn
- date
- bundle exec rake karma
karma:
extends: .karma-base
2019-04-12 04:56:38 -04:00
coverage: '/^Statements *: (\d+\.\d+%)/'
artifacts:
name: coverage-javascript
expire_in: 31d
when: always
paths:
- chrome_debug.log
- coverage-javascript/
2019-07-18 13:52:52 -04:00
- tmp/tests/frontend/
reports:
junit: junit_karma.xml
2019-04-12 04:56:38 -04:00
karma-foss:
extends:
- .karma-base
- .only-ee-as-if-foss
.jest-base:
extends: .only-code-frontend-job-base
2019-04-12 04:56:38 -04:00
script:
- scripts/gitaly-test-spawn
- date
- bundle exec rake frontend:fixtures
2019-04-12 04:56:38 -04:00
- date
- yarn jest --ci --coverage
cache:
key: jest
paths:
- tmp/jest/jest/
policy: pull-push
jest:
extends: .jest-base
2019-04-12 04:56:38 -04:00
artifacts:
name: coverage-frontend
expire_in: 31d
when: always
paths:
- coverage-frontend/
- junit_jest.xml
2019-07-18 13:52:52 -04:00
- tmp/tests/frontend/
reports:
junit: junit_jest.xml
jest-foss:
extends:
- .jest-base
- .only-ee-as-if-foss
2019-04-12 04:56:38 -04:00
cache:
policy: pull
2019-04-12 04:56:38 -04:00
.qa-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .only-code-qa-changes
dependencies: []
stage: test
before_script:
2019-04-12 04:56:38 -04:00
- cd qa/
- bundle install
qa:internal:
extends: .qa-job-base
script:
2019-04-12 04:56:38 -04:00
- bundle exec rspec
qa:selectors:
extends: .qa-job-base
2019-04-12 04:56:38 -04:00
script:
- bundle exec bin/qa Test::Sanity::Selectors
.qa-frontend-node:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .only-code-changes
dependencies: []
2019-04-12 04:56:38 -04:00
cache:
key: "$CI_JOB_NAME"
paths:
- .yarn-cache/
policy: pull-push
script:
- date
2019-07-02 10:29:47 -04:00
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
2019-04-12 04:56:38 -04:00
- date
- yarn run webpack-prod
qa-frontend-node:8:
extends: .qa-frontend-node
image: node:carbon
2019-04-12 04:56:38 -04:00
qa-frontend-node:10:
extends: .qa-frontend-node
image: node:dubnium
2019-04-12 04:56:38 -04:00
qa-frontend-node:latest:
extends: .qa-frontend-node
image: node:latest
2019-04-12 04:56:38 -04:00
allow_failure: true
2019-09-11 12:36:18 -04:00
webpack-dev-server:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .only-code-changes
dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
2019-09-11 12:36:18 -04:00
variables:
WEBPACK_MEMORY_TEST: "true"
script:
- node --version
- node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js