forked from mozilla/testpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
187 lines (187 loc) · 5.3 KB
/
circle.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
version: 2.0
notify:
branches:
only:
- master
- l10n
jobs:
build:
docker:
- image: circleci/node:8.9.4
working_directory: ~/testpilot
steps:
- checkout
- restore_cache:
keys:
- node-modules-
- run:
name: Setup env
command: |
curl -L -o ~/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && chmod +x ~/bin/jq
./bin/circleci/install-node-dependencies.sh
- run:
name: Build addon and frontend
command: |
./bin/circleci/build-addon.sh
./bin/circleci/build-version-json.sh
./bin/circleci/build-frontend.sh
- store_artifacts:
path: ~/testpilot/addon/update.rdf
- store_artifacts:
path: ~/testpilot/addon/addon.xpi
- store_artifacts:
path: ~/testpilot/frontend.zip
- persist_to_workspace:
root: .
paths:
- ./*
- save_cache:
key: node-modules-
paths:
- addon/node_modules
unit_test:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run: mkdir junit
- run: ./bin/circleci/test-addon.sh
- run:
command: ./bin/circleci/test-frontend.sh
environment:
MOCHA_FILE: junit/test-results.xml
- store_test_results:
path: junit
- run:
name: Codecov
command: bash <(curl -s https://codecov.io/bash)
integration_test:
docker:
- image: circleci/node:8.9.4
environment:
- MOZ_HEADLESS: 1
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- integration-test-{{ checksum "frontend/test/ui/requirements/flake8.txt" }}
- integration-test-{{ checksum "frontend/test/ui/requirements/requirements.txt" }}
- integration-test-
- run:
name: Set hosts
command: |
echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
cat /etc/hosts
- run:
name: Install dependencies
command: ./bin/circleci/install-test-dependencies.sh
- run:
name: Flake8
command: ./bin/circleci/flake8.sh
- run: mkdir integration-test-results
- run:
name: Test Firefox Release
command: ./bin/circleci/test-firefox-release.sh
- run:
name: Test Firefox Nightly
command: ./bin/circleci/test-firefox-nightly.sh
- store_artifacts:
path: ~/project/integration-test-results
- save_cache:
key: integration-test-{{ checksum "frontend/test/ui/requirements/flake8.txt" }}
paths:
- frontend/test/ui/requirements/flake8.txt
- save_cache:
key: integration-test-{{ checksum "frontend/test/ui/requirements/requirements.txt" }}
paths:
- frontend/test/ui/requirements/requirements.txt
- save_cache:
key: integration-test-
paths:
- .tox
static_deploy:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run:
name: Install AWSCLI
command: |
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install awscli --upgrade
- run:
name: Static deployment
command: |
TESTPILOT_BUCKET=testpilot.dev.mozaws.net ./bin/circleci/do-exclusively.sh --branch master ./bin/deploy.sh dev
./bin/circleci/invalidate-cloudfront-cache.sh E2ERG47PHCWD0Z
storybook_deploy:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run:
name: Install AWSCLI
command: |
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install awscli --upgrade
- run:
name: Storybook Deploy
command: ./bin/deploy-storybook.sh
l10n_deploy:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run:
name: Install AWSCLI
command: |
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install awscli --upgrade
- run:
name: l10n deployment
command: |
TESTPILOT_BUCKET=testpilot-l10n.dev.mozaws.net ./bin/deploy.sh dev
./bin/circleci/invalidate-cloudfront-cache.sh ELL21V1NJAJJ8
workflows:
version: 2
build_test_deploy:
jobs:
- build
- unit_test:
requires:
- build
- integration_test:
requires:
- build
filters:
branches:
ignore:
- l10n
- storybook_deploy:
requires:
- build
filters:
branches:
ignore:
- l10n
- static_deploy:
requires:
- unit_test
- integration_test
filters:
branches:
only: master
- l10n_deploy:
requires:
- unit_test
filters:
branches:
only: l10n