-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy path.travis.yml
151 lines (151 loc) · 4.59 KB
/
.travis.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
language: node_js
dist: jammy
cache: yarn
env:
global:
- PR_TITLE=$(curl https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST} 2> /dev/null | grep "title" | head -1)
stages:
- prebuild
- build
- docs
- test
- screenshots
- deploy
jobs:
include:
- name: 'Lint'
stage: 'prebuild'
script: yarn lint
if: commit_message =~ /^((?!\[only argos\]).)*$/ # if commit message doesn't contain "[only argos]" string
- name: 'Sprite and Palette'
stage: 'prebuild'
script: yarn makeSpriteAndPalette
workspaces:
create:
name: sprite-palette-binaries
paths:
- ./react/Icon/icons-sprite.js
- ./react/palette.js
- name: 'Build JS'
stage: 'build'
script:
- yarn build
workspaces:
use:
- sprite-palette-binaries
create:
name: js-binaries
paths:
- ./transpiled
- ./dist
- name: 'Build CSS'
stage: 'build'
script:
- yarn build:css:all
workspaces:
create:
name: css-binaries
paths:
- ./dist
- name: 'Build docs'
stage: 'docs'
script:
- yarn build:doc:react
- yarn build:doc:kss
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
create:
name: docs-binaries
paths:
- ./build
- name: 'Tests without snapshots'
stage: 'test'
script:
- yarn test:noSnapshots
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
if: commit_message =~ /^((?!\[only argos\]).)*$/ # if commit message doesn't contain "[only argos]" string
- name: 'Tests snapshots'
stage: 'test'
script:
- yarn test:snapshots
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
if: commit_message =~ /^((?!\[only argos\]).)*$/ # if commit message doesn't contain "[only argos]" string
- name: 'Bundlemon'
stage: 'test'
script:
- yarn bundlemon
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
if: commit_message =~ /^((?!\[only argos\]).)*$/ # if commit message doesn't contain "[only argos]" string
- name: 'Argos desktop'
stage: 'screenshots'
script: |
if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then
mkdir ./screenshots
yarn screenshots --mode react --viewport desktop --screenshot-dir ./screenshots/reactDesktop
yarn argos:upload --parallel screenshots/reactDesktop/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore ''
fi
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
- docs-binaries
- name: 'Argos mobile'
stage: 'screenshots'
script: |
if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then
mkdir ./screenshots
yarn screenshots --mode react --viewport 300x600 --screenshot-dir ./screenshots/reactMobile
yarn argos:upload --parallel screenshots/reactMobile/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore ''
fi
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
- docs-binaries
- name: 'Argos kss'
stage: 'screenshots'
script: |
if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then
mkdir ./screenshots
yarn screenshots --mode kss --screenshot-dir ./screenshots/kss
yarn argos:upload --parallel screenshots/kss/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore ''
fi
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
- docs-binaries
- name: 'Deploy'
stage: 'deploy'
script: 'true'
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
- docs-binaries
deploy:
provider: script
skip-cleanup: true
script: yarn deploy:doc -- --username cozycloud --email [email protected] --repo https://cozy-bot:[email protected]/cozy/cozy-ui.git && yarn semantic-release
on:
branch: master
if: commit_message =~ /^((?!\[only argos\]).)*$/ # if commit message doesn't contain "[only argos]" string