forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
83 lines (73 loc) · 1.99 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
stages:
- test
# These need to have separate stages, otherwise artifacts would overwrite each other
- te-build
- te-s3
- ee-build-test # rudder-rc, stripe-test
- ee-s3-test
- ee-build-live # rudder-live, stripe-live
- ee-s3-live
- ee-build-onprem-rc # rudder-rc, stripe-test
- ee-s3-onprem-rc
- ee-build-onprem # rudder-live, stripe-test
- ee-s3-onprem
- create-vars
- trigger
variables:
ONLY_BUILD: "yes"
ONLY_TEST: "no"
include:
- project: mattermost/ci/mattermost-webapp
ref: master
file: private.yml
- local: .gitlab-ci/check.gitlab-ci.yml
empty:
stage: create-vars
script:
- echo "empty"
prepare:
stage: .pre
image: $CI_REGISTRY/mattermost/ci/images/mattermost-build-webapp:20200829_node-10.22
cache:
key:
files:
- package.json
prefix: ${CI_COMMIT_REF_SLUG}
paths:
- .npm/
- node_modules/
script:
- npm ci --cache .npm --prefer-offline && cd node_modules/mattermost-redux && npm i && npm run build && cd -
rules:
- if: '$ONLY_BUILD != "yes"'
lint:
extends: .check
script:
- npm run check
rules:
- if: '$ONLY_BUILD != "yes"'
test: #todo check on how to create junit.xml, there currently is none
extends: .check
script:
- npm run test-ci
rules:
- if: '$ONLY_BUILD != "yes"'
type-check:
extends: .check
script:
- npm run check-types
rules:
- if: '$ONLY_BUILD != "yes"'
i18n-check:
extends: .check
script:
- cp i18n/en.json /tmp/en.json
- mkdir -p /tmp/fake-mobile-dir/assets/base/i18n/
- echo '{}' > /tmp/fake-mobile-dir/assets/base/i18n/en.json
- npm run mmjstool -- i18n extract-webapp --webapp-dir . --mobile-dir /tmp/fake-mobile-dir
- diff /tmp/en.json i18n/en.json
# Address weblate behavior which does not remove whole translation item when translation string is set to empty
- npm run mmjstool -- i18n clean-empty --webapp-dir . --mobile-dir /tmp/fake-mobile-dir --check
- rm -rf tmp
rules:
- if: '$ONLY_BUILD != "yes"'