-
Notifications
You must be signed in to change notification settings - Fork 7
243 lines (237 loc) · 9.9 KB
/
acms.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: acquia-cms-starterkit CI
on:
schedule:
# "At minute 0 past hour 4 and 8 UTC."
- cron: '0 4,8 * * *'
push:
branches: [ develop, main, ACMS* ]
paths-ignore:
- README.md
pull_request:
branches: [ develop ]
paths-ignore:
- README.md
env:
ORCA_SUT_NAME: acquia/acquia-cms-starterkit
ORCA_SUT_BRANCH: develop
ORCA_VERSION: ^4
ORCA_PACKAGES_CONFIG_ALTER: ../acquia-cms-starterkit/tests/packages_alter.yml
ORCA_ENABLE_NIGHTWATCH: "FALSE"
DB_DATABASE: drupal
DB_USER: drupal
DB_PASSWORD: drupal
ORCA_PHPCS_STANDARD: AcquiaPHP
COMPOSER_PROCESS_TIMEOUT: 1800
jobs:
# @todo add tests to validate each starter-kit use case.
STATIC_CODE_ANALYSIS:
name: "Static Code Analysis"
runs-on: ubuntu-latest
env:
ORCA_JOB: STATIC_CODE_ANALYSIS
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug
- name: Download ORCA
run: composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n
- name: Run GrumpPHP tests
run: |
composer install
./vendor/bin/grumphp run
- name: Before Install
run: ../orca/bin/ci/before_install.sh
- name: Install
shell: 'script -q -e -c "bash {0}"'
run: ../orca/bin/ci/install.sh
- name: Before script
run: ../orca/bin/ci/before_script.sh
- name: Script
run: ../orca/bin/ci/script.sh
- name: After script
run: |
../orca/bin/ci/after_success.sh
../orca/bin/ci/after_failure.sh
../orca/bin/ci/after_script.sh
VERIFY_ACMS_STARTERKIT_ON_DRUPAL_PROJECT:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
name: "Verify ${{ matrix.starter-kits }} with demo-content=${{ matrix.demo-content }}, content-model=${{ matrix.content-model }}, dam-integration=${{ matrix.dam-integration }}, gdpr-integration=${{ matrix.gdpr-integration }}, core-version=${{ matrix.core-version }} on acquia/drupal-recommended-project"
runs-on: ubuntu-latest
env:
demo_content: ${{ matrix.demo-content }}
content_model: ${{ matrix.content-model }}
dam_integration: ${{ matrix.dam-integration }}
CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }}
GMAPS_KEY: ${{ secrets.GMAPS_KEY }}
SEARCH_UUID: ${{ secrets.SEARCH_UUID }}
SITESTUDIO_API_KEY: ${{ secrets.SITESTUDIO_API_KEY }}
SITESTUDIO_ORG_KEY: ${{ secrets.SITESTUDIO_ORG_KEY }}
gdpr_integration: ${{ matrix.gdpr-integration }}
CI: TRUE
strategy:
matrix:
core-version: ["CURRENT", "OLDEST_SUPPORTED"]
starter-kits: ["acquia_cms_enterprise_low_code", "acquia_cms_community", "acquia_cms_headless"]
demo-content: ["yes", "no"]
content-model: ["yes", "no"]
dam-integration: ["yes", "no"]
gdpr-integration: ["yes", "no"]
exclude:
- demo-content: "yes"
content-model: "yes"
- demo-content: "no"
content-model: "no"
dam-integration: "yes"
- demo-content: "yes"
content-model: "no"
dam-integration: "no"
- demo-content: "no"
content-model: "no"
gdpr-integration: "yes"
- demo-content: "yes"
content-model: "no"
gdpr-integration: "no"
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
mysql -e 'CREATE USER "drupal"@"localhost" IDENTIFIED BY "drupal";' -uroot -proot
mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "drupal"@"localhost" WITH GRANT OPTION;' -uroot -proot
mysql -e 'FLUSH PRIVILEGES;' -uroot -proot
mysql -e 'SHOW GRANTS FOR "drupal"@"localhost";' -uroot -proot
- name: Download Composer Dependencies
run: composer install
- name: Download ORCA
run: |
cd ..
composer create-project --no-dev --ignore-platform-req=php acquia/orca orca "$ORCA_VERSION"
cd -
- name: Before Install
run: ../orca/bin/orca fixture:init --core=${{ matrix.core-version }} --sut=${ORCA_SUT_NAME} --profile=minimal --no-site-install --no-sqlite
- name: Install
shell: 'script -q -e -c "bash {0}"'
run: |
cd ../orca-build
composer config -g github-oauth.github.com ${{ secrets.OAUTH_TOKEN }}
# For drupal core 10.1.x, we've to use Acquia CMS Common of release 3.2.x.
bash -c 'VERSION=$(composer show drupal/core | grep "versions" | sed "s/[^0-9.]//g"); [[ "${VERSION}" == 10.1.* ]] && sed -i "s/shield/shield\n - acquia_cms_common:~3.2.8/" ../acquia-cms-starterkit/acms/acms.yml;'
./vendor/bin/acms acms:install ${{ matrix.starter-kits }} --uri=${{ matrix.starter-kits }} --no-interaction
# Revert back, after above command runs.
cd - && git checkout .
- name: Execute all PHPUnit tests
run: ./vendor/bin/phpunit
- name: Before script
run: ../orca/bin/ci/before_script.sh
- name: Script
run: ../orca/bin/ci/script.sh
- name: After script
run: |
../orca/bin/ci/after_success.sh
../orca/bin/ci/after_failure.sh
../orca/bin/ci/after_script.sh
VERIFY_ACMS_HEADLESS_WITH_NEXTJS:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
name: "Verify ACMS Headless and NextJs with core-version=${{ matrix.core-version }} on acquia/drupal-recommended-project"
runs-on: ubuntu-latest
env:
demo_content: "yes"
CONNECTOR_ID: ${{ secrets.CONNECTOR_ID }}
GMAPS_KEY: ${{ secrets.GMAPS_KEY }}
SEARCH_UUID: ${{ secrets.SEARCH_UUID }}
nextjs_app: "yes"
nextjs_app_site_url: "http://localhost:3000"
nextjs_app_site_name: "Headless Site 1"
nextjs_app_env_file: ""
CI: TRUE
strategy:
matrix:
core-version: ["CURRENT", "OLDEST_SUPPORTED"]
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug
- name: Setup NextJs Application
run: |
cd ..
npx create-next-app -e https://github.com/acquia/next-acms/tree/main/starters/basic-starter nextjs_app
cd nextjs_app
cp .env.example .env.local
nextjs_app_path=$(pwd)
echo "${nextjs_app_path}"
echo "nextjs_app_env_file=${nextjs_app_path}/.env.local" >> ${GITHUB_ENV}
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
mysql -e 'CREATE USER "drupal"@"localhost" IDENTIFIED BY "drupal";' -uroot -proot
mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "drupal"@"localhost" WITH GRANT OPTION;' -uroot -proot
mysql -e 'FLUSH PRIVILEGES;' -uroot -proot
mysql -e 'SHOW GRANTS FOR "drupal"@"localhost";' -uroot -proot
- name: Download Composer Dependencies
run: composer install
- name: Download ORCA
run: |
cd ..
composer create-project --no-dev --ignore-platform-req=php acquia/orca orca "$ORCA_VERSION"
cd -
- name: Before Install
run: ../orca/bin/orca fixture:init --core=${{ matrix.core-version }} --sut=${ORCA_SUT_NAME} --profile=minimal --no-site-install --no-sqlite
- name: Install
shell: 'script -q -e -c "bash {0}"'
run: |
cd ../orca-build
composer config -g github-oauth.github.com ${{ secrets.OAUTH_TOKEN }}
# The composer tries to download the latest minor release of Acquia CMS Common i.e 3.3.x,
# but it supports 10.2.x and above. So for drupal core 10.1.x, we've to use release 3.2.x.
bash -c 'VERSION=$(composer show drupal/core | grep "versions" | sed "s/[^0-9.]//g"); [[ "${VERSION}" == 10.1.* ]] && sed -i "s/shield/shield\n - acquia_cms_common:~3.2.8/" ../acquia-cms-starterkit/acms/acms.yml;'
./vendor/bin/acms acms:install acquia_cms_headless --no-interaction
# Revert back acms.yml file changes that we've updated earlier to make sure CI pass for Drupal Core 10.1.x.
cd - && git checkout .
- name: Execute all PHPUnit tests
run: ./vendor/bin/phpunit
- name: Before script
run: ../orca/bin/ci/before_script.sh
- name: Script
run: ../orca/bin/ci/script.sh
- name: After script
run: |
../orca/bin/ci/after_success.sh
../orca/bin/ci/after_failure.sh
../orca/bin/ci/after_script.sh
VERIFY_ACMS_INSTALL_CURRENT_PROJECT:
name: "Verify commands on current project (Non Drupal)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
mysql -e 'CREATE USER "drupal"@"localhost" IDENTIFIED BY "drupal";' -uroot -proot
mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "drupal"@"localhost" WITH GRANT OPTION;' -uroot -proot
mysql -e 'FLUSH PRIVILEGES;' -uroot -proot
mysql -e 'SHOW GRANTS FOR "drupal"@"localhost";' -uroot -proot
- name: Download Composer Dependencies
run: composer install
- name: Install
shell: 'script -q -e -c "bash {0}"'
run: ./bin/acms acms:install --no-interaction
- name: Execute all PHPUnit tests
run: ./vendor/bin/phpunit