-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
config.yml
181 lines (172 loc) · 5.64 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
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
defaults: &defaults
working_directory: ~/drush
resource_class: large
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
TERM: dumb
SYMFONY_DEPRECATIONS_HELPER: disabled
PHPUNIT_ARGS: ""
PHP_SENDMAIL_PATH: /dev/null
# https://drupal.slack.com/archives/CGKLP028K/p1702031434143329?thread_ts=1702024395.751479&cid=CGKLP028K
WODBY_TAG: 8.2
# These are not working. We disable the mode in .docker/zz-php.ini
PHP_EXTENSIONS_DISABLE: xdebug
PHP_XDEBUG_MODE: off
requires: &requires
requires:
- check_mergable
- code_style
post_steps: &poststeps
post-steps:
- store_test_results:
path: /tmp/results
- store_artifacts:
path: /tmp/results
commands:
# https://support.circleci.com/hc/en-us/articles/360046718553-PHP-Composer-Fails-With-Could-not-authenticate-against-github-com
composer-auth:
steps:
# This env var is available to forked PRs as it has no special perms.
- run: |
if [ -n "$GITHUB_PAT" ]; then
composer config --auth github-oauth.github.com $GITHUB_PAT
fi
executors:
mysql-stable:
docker:
- image: wodby/php:$WODBY_TAG
environment:
- MYSQL_HOST=127.0.0.1
- UNISH_DB_URL=mysql://root:@127.0.0.1/unish_dev?module=mysql
- image: cimg/mysql:5.7.38
sqlite-stable:
docker:
- image: wodby/php:$WODBY_TAG
environment:
- "UNISH_DB_URL=sqlite://localhost/:memory:?module=sqlite"
mysql-highest:
docker:
- image: wodby/php:latest
environment:
- MYSQL_HOST=127.0.0.1
- UNISH_DB_URL=mysql://root:@127.0.0.1/unish_dev?module=mysql
- image: cimg/mysql:5.7.38
postgres-stable:
docker:
- image: wodby/php:$WODBY_TAG
environment:
- UNISH_DB_URL=pgsql://unish:unish@127.0.0.1/unish_dev?module=pgsql
- image: wodby/postgres:14
environment:
POSTGRES_DB_EXTENSIONS: pg_trgm
POSTGRES_PASSWORD: unish
POSTGRES_DB: unish_dev
POSTGRES_USER: unish
version: 2.1
jobs:
# Code style test:
# FAIL if code does not conform to code style conventions
# PASS otherwise
code_style:
<<: *defaults
docker:
- image: wodby/php:8.2
steps:
- checkout
- run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/
- composer-auth
- run: composer -n validate --no-check-all
- run: composer -n -v install
- run: mkdir -p /tmp/results
- run: composer -n cs -- --report=junit --report-file=/tmp/results/junit.phpcs.xml
- run: vendor/bin/phpstan --error-format=junit > /tmp/results/phpstan.junit.xml
# Mergeable test:
# FAIL if merging test branch with 12.x produces conflicts
# PASS if the test branch is out of date, but mergeable without conflicts
check_mergable:
<<: *defaults
docker:
- image: cimg/base:2022.09
steps:
- checkout
- run: $HOME/drush/.circleci/mergable.sh
test:
parameters:
dbms:
type: string
suite:
type: string
release:
type: string
<<: *defaults
executor: << parameters.dbms >>-<< parameters.release >>
steps:
- checkout
- run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/
- run: php -i
- run: mkdir -p /tmp/results
- composer-auth
- when:
condition:
and:
- equal: [ stable, << parameters.release >> ]
steps:
- run: composer -n install
- unless:
condition:
and:
- equal: [ stable, << parameters.release >> ]
steps:
- run: composer -n config platform.php --unset
- run: composer -n require --dev drupal/core-recommended:11.x-dev --no-update
- run: composer -n update
- run: composer -n unit -- --log-junit /tmp/results/unit/junit.xml
- run: composer -n << parameters.suite >> -- --log-junit /tmp/results/<< parameters.suite >>/junit.xml
# Drupal 9.2.8 for Security test coverage for drupal/core
# test_80_drupal92_security:
# <<: *defaults
# docker:
# - image: wodby/php:8.0
# environment:
# - MYSQL_HOST=127.0.0.1
# - UNISH_DB_URL=mysql://root:@127.0.0.1/unish_dev?module=mysql
# - image: cimg/mysql:5.7.38
# steps:
# - checkout
# - run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/
# - run: composer -n require --dev drupal/core-recommended:9.2.8 --no-update
# - run: php --version
# - run: composer -n update
# - run: composer -n phpunit -- --testsuite integration --filter=testInsecureDrupalPackage --stop-on-skipped
workflows:
drush:
jobs:
- code_style:
<<: *poststeps
- check_mergable
# - test_80_drupal92_security:
# <<: *requires
- test:
<<: *requires
<<: *poststeps
matrix:
parameters:
#sqlite removed pending https://github.com/wodby/php/issues/194
dbms: [ mysql, postgres ]
suite: [integration, functional]
release: [stable, highest]
exclude:
# Only run highest test on mysql. Excluding each suite is unfortunate but needed.
- release: highest
dbms: sqlite
suite: integration
- release: highest
dbms: sqlite
suite: functional
- release: highest
dbms: postgres
suite: integration
- release: highest
dbms: postgres
suite: functional