Commit 28cfd6d0 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'use-rules-for-frontend-jobs' into 'master'

Use 'rules' for all frontend jobs

See merge request gitlab-org/gitlab!24061
parents cb3597de 4a0b2339
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
- "doc/README.md" # Some RSpec test rely on this file - "doc/README.md" # Some RSpec test rely on this file
# Make sure to update all the similar patterns in other CI config files if you modify these patterns # Make sure to update all the similar patterns in other CI config files if you modify these patterns
.code-backstage-patterns-qa: &code-backstage-patterns-qa .code-backstage-qa-patterns: &code-backstage-qa-patterns
- ".gitlab/ci/**/*" - ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}" - ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml" - ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
...@@ -118,7 +118,7 @@ gitlab:assets:compile pull-push-cache: ...@@ -118,7 +118,7 @@ gitlab:assets:compile pull-push-cache:
- <<: *if-not-canonical-namespace - <<: *if-not-canonical-namespace
when: never when: never
- <<: *if-master-refs - <<: *if-master-refs
changes: *code-backstage-patterns-qa changes: *code-backstage-qa-patterns
when: on_success when: on_success
cache: cache:
policy: pull-push policy: pull-push
...@@ -129,7 +129,7 @@ gitlab:assets:compile pull-cache: ...@@ -129,7 +129,7 @@ gitlab:assets:compile pull-cache:
- <<: *if-not-canonical-namespace - <<: *if-not-canonical-namespace
when: never when: never
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns-qa changes: *code-backstage-qa-patterns
when: on_success when: on_success
cache: cache:
policy: pull policy: pull
...@@ -163,7 +163,7 @@ compile-assets pull-push-cache: ...@@ -163,7 +163,7 @@ compile-assets pull-push-cache:
extends: .compile-assets-metadata extends: .compile-assets-metadata
rules: rules:
- <<: *if-master-refs - <<: *if-master-refs
changes: *code-backstage-patterns-qa changes: *code-backstage-qa-patterns
when: on_success when: on_success
cache: cache:
policy: pull-push policy: pull-push
...@@ -176,7 +176,7 @@ compile-assets pull-push-cache foss: ...@@ -176,7 +176,7 @@ compile-assets pull-push-cache foss:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-master-refs - <<: *if-master-refs
changes: *code-backstage-patterns-qa changes: *code-backstage-qa-patterns
when: on_success when: on_success
cache: cache:
policy: pull-push policy: pull-push
...@@ -186,7 +186,7 @@ compile-assets pull-cache: ...@@ -186,7 +186,7 @@ compile-assets pull-cache:
extends: .compile-assets-metadata extends: .compile-assets-metadata
rules: rules:
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns-qa changes: *code-backstage-qa-patterns
when: on_success when: on_success
cache: cache:
policy: pull policy: pull
...@@ -199,26 +199,24 @@ compile-assets pull-cache foss: ...@@ -199,26 +199,24 @@ compile-assets pull-cache foss:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns-qa changes: *code-backstage-qa-patterns
when: on_success when: on_success
cache: cache:
policy: pull policy: pull
key: "assets-compile:v8:foss" key: "assets-compile:v8:foss"
.only-code-frontend-job-base: .frontend-job-base:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-only
- .default-before_script - .default-before_script
- .only:changes-code-backstage
- .use-pg9 - .use-pg9
stage: test stage: test
needs: ["setup-test-env", "compile-assets pull-cache"] needs: ["setup-test-env", "compile-assets pull-cache"]
.karma-base: .karma-base:
extends: .only-code-frontend-job-base extends: .frontend-job-base
variables: variables:
# we override the max_old_space_size to prevent OOM errors # we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584 NODE_OPTIONS: --max_old_space_size=3584
...@@ -231,6 +229,10 @@ compile-assets pull-cache foss: ...@@ -231,6 +229,10 @@ compile-assets pull-cache foss:
karma: karma:
extends: .karma-base extends: .karma-base
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
coverage: '/^Statements *: (\d+\.\d+%)/' coverage: '/^Statements *: (\d+\.\d+%)/'
artifacts: artifacts:
name: coverage-javascript name: coverage-javascript
...@@ -246,10 +248,16 @@ karma: ...@@ -246,10 +248,16 @@ karma:
karma-foss: karma-foss:
extends: extends:
- .karma-base - .karma-base
- .only-ee-as-if-foss - .as-if-foss
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
.jest-base: .jest-base:
extends: .only-code-frontend-job-base extends: .frontend-job-base
script: script:
- scripts/gitaly-test-spawn - scripts/gitaly-test-spawn
- date - date
...@@ -264,6 +272,10 @@ karma-foss: ...@@ -264,6 +272,10 @@ karma-foss:
jest: jest:
extends: .jest-base extends: .jest-base
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
artifacts: artifacts:
name: coverage-frontend name: coverage-frontend
expire_in: 31d expire_in: 31d
...@@ -278,7 +290,13 @@ jest: ...@@ -278,7 +290,13 @@ jest:
jest-foss: jest-foss:
extends: extends:
- .jest-base - .jest-base
- .only-ee-as-if-foss - .as-if-foss
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
cache: cache:
policy: pull policy: pull
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment