forked from rifflearning/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
75 lines (66 loc) · 1.77 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
image: node:10
# Cache modules in between jobs (caching setup copied from https://docs.gitlab.com/ee/ci/caching/index.html)
# Use specific job cache settings to allow 1 setup job to push, and all other jobs to pull
#cache:
# key: ${CI_COMMIT_REF_SLUG}
# paths:
# - node_modules/
.job_template: &std_job
cache: &pull_module_cache
key: ${CI_COMMIT_REF_SLUG}
policy: pull
paths:
- node_modules/
only: &only_constraints
- merge_requests
- /^(fix|feature|meta)/
- tags
stages:
- setup
- test
- deploy
before_script:
# setting unsafe-perm and shell config is needed to get the mattermost-redux
# dependency correctly installed BECAUSE it is a git url w/ a prepare script
# AND the node image user is root! npm acts differently when run as root!
- npm config set unsafe-perm true
- npm config set shell /bin/bash
npm-install:
stage: setup
script:
- npm install
only: *only_constraints
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
check-style:
<<: *std_job
stage: test
script:
- make check-style-ci THRESHOLD=1589
artifacts:
when: always
paths:
- build/check-style.log.html
test:
<<: *std_job
stage: test
script:
- make test-ci
- tail --lines=14 build/test.log
allow_failure: true
artifacts:
when: always
paths:
- build/test.log
- build/test-results.xml
build:
<<: *std_job
stage: test # test rather than build, as it doesn't need to complete before testing
script:
- make build > build/build.log
artifacts:
when: always
paths:
- build/build.log