-
-
Notifications
You must be signed in to change notification settings - Fork 135
/
config.yml
194 lines (172 loc) · 6.88 KB
/
config.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
188
189
190
191
192
193
194
version: 2.0
aliases:
- &workspace_root ~/neos-ui-workspace
- &store_yarn_package_cache
key: yarn-cache-v{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- &restore_yarn_package_cache
keys:
- yarn-cache-v{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- &store_app_cache
key: full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}-{{ checksum "Tests/IntegrationTests/TestDistribution/Configuration/Settings.yaml" }}
paths:
- /home/circleci/app
- &restore_app_cache
keys:
- full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}-{{ checksum "Tests/IntegrationTests/TestDistribution/Configuration/Settings.yaml" }}
- full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}-
- full-app-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-
- &save_composer_cache
key: composer-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}
paths:
- /home/circleci/composer/cache-dir
- &restore_composer_cache
keys:
- composer-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ checksum "Tests/IntegrationTests/TestDistribution/composer.json" }}
- composer-cache-v{{ .Environment.CACHE_VERSION }}-{{ arch }}-
- &attach_workspace
at: *workspace_root
- &persist_to_workspace
root: .
paths:
- .
jobs:
checkout:
docker:
- image: cimg/node:16.17-browsers
environment:
FLOW_CONTEXT: Production
steps:
- checkout
- restore_cache: *restore_yarn_package_cache
- run: node --version
- run: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
- run: chmod +x ~/.nvm/nvm.sh
- run: ~/.nvm/nvm.sh install && ~/.nvm/nvm.sh use
- run: sudo apt-get update --allow-releaseinfo-change && sudo apt-get install -y rsync
- run: make install && make build-e2e-testing
- save_cache: *store_yarn_package_cache
- persist_to_workspace: *persist_to_workspace
build_flow_app:
working_directory: *workspace_root
environment:
COMPOSER_CACHE_DIR: /home/circleci/composer/cache-dir
docker:
- image: cimg/php:8.0-node
steps:
- attach_workspace: *attach_workspace
- run: chmod -R 777 /home/circleci
- restore_cache: *restore_composer_cache
- run: mkdir -p /home/circleci/app/Configuration
- run: rm -rf /home/circleci/app && cp -r Tests/IntegrationTests/TestDistribution/ /home/circleci/app
- run: cd /home/circleci/app && composer install
- save_cache: *save_composer_cache
- save_cache: *store_app_cache
e2e:
environment:
FLOW_CONTEXT: Production
docker:
- image: cimg/php:8.0-node
- image: cimg/mariadb:10.6
environment:
MYSQL_DATABASE: neos
MYSQL_ROOT_PASSWORD: not_a_real_password
working_directory: *workspace_root
steps:
- attach_workspace: *attach_workspace
- restore_cache: *restore_app_cache
- run: rm -rf /home/circleci/app/Packages/Application/Neos.Neos.Ui
- run: cd /home/circleci/app/Packages/Application && mv ~/neos-ui-workspace Neos.Neos.Ui
- run: |
cd /home/circleci/app/
./flow flow:cache:flush
./flow flow:cache:warmup
./flow doctrine:migrate
./flow user:create --username=admin --password=password --first-name=John --last-name=Doe --roles=Administrator
- run:
name: Start flow server
command: /home/circleci/app/flow server:run --port 8081
background: true
- run: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
- run: chmod +x ~/.nvm/nvm.sh
- run:
no_output_timeout: 30m
command: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
cd /home/circleci/app/Packages/Application/Neos.Neos.Ui
nvm install
nvm use
make test-e2e-saucelabs > /home/circleci/app/Data/Logs/AcceptanceTesting.log
- store_artifacts:
path: /home/circleci/app/Data/Logs
- persist_to_workspace:
root: /home/circleci/app/Data/Logs
paths:
- .
post-acceptance-tests-recordings:
environment:
FLOW_CONTEXT: Production
docker:
- image: cimg/php:8.0-node
steps:
- attach_workspace:
at: /home/circleci/app
- run:
name: Install GitHub CLI and jq
command: |
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
- run:
name: Run Script
command: |
JOB_IDS=$(cat /home/circleci/app/AcceptanceTesting.log | grep -o 'https://app.saucelabs.com/tests/[a-zA-Z0-9]\+' | sed 's/.*\///')
echo "Job IDs: $JOB_IDS"
/home/circleci/app/Build/comment-acceptance-tests.sh "$JOB_IDS" "$(basename "$CIRCLE_PULL_REQUEST")"
php-unittests:
environment:
FLOW_CONTEXT: Production
docker:
- image: cimg/php:8.0-node
- image: cimg/mariadb:10.6
environment:
MYSQL_DATABASE: neos
MYSQL_ROOT_PASSWORD: not_a_real_password
working_directory: *workspace_root
steps:
- attach_workspace: *attach_workspace
- restore_cache: *restore_app_cache
- run: rm -rf /home/circleci/app/Packages/Application/Neos.Neos.Ui
- run: cd /home/circleci/app/Packages/Application && mv ~/neos-ui-workspace Neos.Neos.Ui
- run: |
cd /home/circleci/app/
bin/phpunit -c Build/BuildEssentials/PhpUnit/UnitTests.xml Packages/Application/Neos.Neos.Ui/Tests/Unit
workflows:
version: 2
build_and_test:
jobs:
- checkout:
filters:
tags:
only:
- /^\d\.\d\.\d/
branches:
only:
- /.*/
- build_flow_app:
requires:
- checkout
- e2e:
requires:
- build_flow_app
- post-acceptance-tests-recordings:
requires:
- e2e
- php-unittests:
requires:
- build_flow_app