forked from Lullabot/drupal9ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
153 lines (139 loc) · 3.75 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
# CircleCI integration with Drupal.
# Reusable steps.
## Copies .circle/Robofile to the repository root.
copy_robo: ©_robo
run:
name: Copy RoboFile.php
command: cp .circleci/RoboFile.php .
update_composer: &update_composer
run:
name: Update composer to version 2
command: composer global remove hirak/prestissimo && composer self-update --2
## Defines images and working directory.
defaults: &defaults
docker:
- image: ghcr.io/lullabot/drupal9ci:latest
environment:
XDEBUG_MODE: coverage
- image: mariadb:10.3
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
working_directory: /opt/drupal
## Defines the cache restoring mechanism.
restore_cache: &restore_cache
# We use the composer.lock as a way to determine if we can cache our build.
keys:
- v2-dependencies-{{ checksum "composer.lock" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-
## Defines the cache saving mechanism.
save_cache: &save_cache
paths:
- ./vendor
- ./web/core
- ./web/modules/contrib
- ./web/themes/contrib
- ./web/profiles/contrib
key: v2-dependencies-{{ checksum "composer.lock" }}
#Jobs
## Job to run Unit and Kernel tests.
unit_kernel_tests: &unit_kernel_tests
<<: *defaults
steps:
- checkout
- *copy_robo
- *update_composer
- restore_cache: *restore_cache
- run:
name: Run PHPUnit tests
command: robo job:run-unit-tests
- store_test_results:
path: /opt/drupal/artifacts/phpunit
- store_artifacts:
path: /opt/drupal/artifacts
- save_cache: *save_cache
## Job to run the update path and Behat tests.
behat_tests: &behat_tests
<<: *defaults
steps:
- checkout
- *copy_robo
- *update_composer
- restore_cache: *restore_cache
- run:
name: Run Behat tests
command: robo job:run-behat-tests
- store_test_results:
path: /opt/drupal/artifacts/behat
- store_artifacts:
path: /opt/drupal/artifacts
- save_cache: *save_cache
## Job to run the update path and Cypress tests.
cypress_tests: &cypress_tests
<<: *defaults
steps:
- checkout
- *copy_robo
- *update_composer
- restore_cache: *restore_cache
- run:
name: Run Cypress tests
command: robo job:run-cypress-tests
- store_test_results:
path: /opt/drupal/artifacts/cypress
- store_artifacts:
path: /opt/drupal/artifacts
- save_cache: *save_cache
## Job to check coding standards.
code_sniffer: &code_sniffer
<<: *defaults
steps:
- checkout
- *copy_robo
- *update_composer
- restore_cache: *restore_cache
- run:
name: Inspect coding standards
command: robo job:check-coding-standards
- store_test_results:
path: /opt/drupal/artifacts/phpcs
- store_artifacts:
path: /opt/drupal/artifacts
- save_cache: *save_cache
## Job to check test coverage.
code_coverage: &code_coverage
<<: *defaults
steps:
- checkout
- *copy_robo
- *update_composer
- restore_cache: *restore_cache
- run:
name: Generate code coverage report
command: robo job:generate-coverage-report
- store_artifacts:
path: /opt/drupal/artifacts
- save_cache: *save_cache
# Declare all of the jobs we should run.
version: 2
jobs:
run-unit-kernel-tests:
<<: *unit_kernel_tests
run-behat-tests:
<<: *behat_tests
run-code-sniffer:
<<: *code_sniffer
run-code-coverage:
<<: *code_coverage
run-cypress-tests:
<<: *cypress_tests
# Declare a workflow that runs all of our jobs in parallel.
workflows:
version: 2
test_and_lint:
jobs:
- run-unit-kernel-tests
- run-behat-tests
- run-code-sniffer
- run-code-coverage
- run-cypress-tests