-
Notifications
You must be signed in to change notification settings - Fork 21
/
orca.yml
247 lines (229 loc) · 11.2 KB
/
orca.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
244
245
246
247
# Example GitHub Actions configuration.
#
# This configuration file will cover ORCA integration for most packages almost
# without modification. Use as follows:
#
# 1. Copy this file to your package root:
#
# $ cp example/.github/workflows/orca.yml ../my_package/.github/workflows/orca.yml
#
# 2. Change the values in jobs.build.env for your package. No other changes are
# strictly necessary for a basic integration.
#
# 3. Review the other comments in the file for additional configuration options.
#
# 4. Strip the (now unnecessary) comments:
#
# $ sed -i'.bak' -e '/^[[:blank:]]*#/d;s/#.*//' orca.yml && rm orca.yml.bak
#
# For advanced needs,
# @see https://github.com/acquia/orca/blob/main/docs/advanced-usage.md
#
# For all GitHub Actions build config options,
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
---
name: ORCA CI
on:
push:
# Prevent duplicate jobs on Dependabot PRs that interfere with automerge.
branches-ignore:
- 'dependabot/**'
pull_request: ~
schedule:
# Daily at 00:00:00 UTC.
# @see https://crontab.cronhub.io/
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-24.04
# Change the following values for your implementation.
env:
# Boolean values must be quoted, otherwise they will be converted to lower case and break ORCA scripts.
# Provide your package's name.
ORCA_SUT_NAME: drupal/example
# Specify the name of the nearest Git version branch, e.g., 1.x or 8.x-1.x.
# This may be the destination branch of a pull request or the nearest
# ancestor of a topic branch. ORCA will rename the checked out Git branch to
# this value to make Composer resolve dependencies correctly on pull
# requests and topic branches.
ORCA_SUT_BRANCH: 8.x-1.x
# Specify the version of ORCA to use. Use dev-main to track the latest
# release, dev-develop to track Dev/HEAD, or any other Composer version
# string. Since ORCA uses Semantic Versioning, the current major version
# branch is recommended in order to receive new features but not unexpected
# backward compatibility breaking changes.
# @see https://getcomposer.org/doc/articles/versions.md
# @see https://semver.org/
# It is also recommended to watch ORCA releases.
# @see https://help.github.com/en/enterprise/2.20/user/github/receiving-notifications-about-activity-on-github/watching-and-unwatching-releases-for-a-repository
ORCA_VERSION: ${{ matrix.orca-version }}
# If you want to completely replace the list of packages ORCA installs in
# fixtures and runs tests on, you can specify your own packages file at
# runtime by uncommenting the following line. Acceptable values are any
# valid path to a YAML file relative to ORCA itself, e.g.,
# ../example/tests/packages.yml.
# @see https://github.com/acquia/orca/blob/develop/config/packages.yml
# ORCA_PACKAGES_CONFIG: ../example/tests/packages.yml
#
# If your package isn't in ORCA's packages.yml or conflicts with details
# that are, you can modify the active packages configuration at runtime by
# uncommenting the following line and specifying your own alter file.
# @see https://github.com/acquia/orca/blob/main/docs/advanced-usage.md#ORCA_PACKAGES_CONFIG_ALTER
# ORCA_PACKAGES_CONFIG_ALTER: ../example/tests/packages_alter.yml
#
# If your package is a Drupal installation profile, uncomment the following
# line and specify its machine name.
# @see https://github.com/acquia/orca/blob/main/docs/advanced-usage.md#ORCA_FIXTURE_PROFILE
# ORCA_FIXTURE_PROFILE: example
#
# If your package is a Composer project template or requires a different
# one to test with, uncomment the following line and specify its Packagist
# name. This is recommended if your package is not meant to support Acquia
# CMS, which is included in acquia/drupal-recommended-project.
# @see https://github.com/acquia/orca/blob/main/docs/advanced-usage.md#ORCA_FIXTURE_PROJECT_TEMPLATE
# @see https://github.com/acquia/orca/blob/main/docs/faq.md#why-do-i-get-version-conflicts-with-drupalacquia_cms
# ORCA_FIXTURE_PROJECT_TEMPLATE: acquia/drupal-minimal-project
#
# Change the PHP Code Sniffer standard used for static analysis. Acceptable
# values are "AcquiaPHP", "AcquiaDrupalStrict", and
# "AcquiaDrupalTransitional". Defaults to "AcquiaDrupalTransitional".
# @see https://github.com/acquia/orca/blob/main/docs/advanced-usage.md#ORCA_PHPCS_STANDARD
# ORCA_PHPCS_STANDARD: AcquiaDrupalTransitional
#
# To enable telemetry on cron runs, uncomment the following line:
# @see https://github.com/acquia/orca/blob/main/docs/advanced-usage.md#ORCA_TELEMETRY_ENABLE
# ORCA_TELEMETRY_ENABLE: "TRUE"
#
# Do not modify the following lines. They are critical for managing the build matrix.
ORCA_JOB: ${{ matrix.orca-job }}
ORCA_ENABLE_NIGHTWATCH: ${{ matrix.orca-enable-nightwatch }}
# Google env variables required for Domo Integration.
ORCA_GOOGLE_API_CLIENT_ID: ${{ secrets.ORCA_GOOGLE_API_CLIENT_ID }}
ORCA_GOOGLE_API_CLIENT_SECRET: ${{ secrets.ORCA_GOOGLE_API_CLIENT_SECRET }}
ORCA_GOOGLE_API_REFRESH_TOKEN: ${{ secrets.ORCA_GOOGLE_API_REFRESH_TOKEN }}
# Execution time is drastically reduced by splitting the build into multiple
# concurrent jobs.
#
# By default, GitHub will cancel the build as soon as any job fails.
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
strategy:
matrix:
# The standard ORCA jobs provide broad out-of-the-box coverage.
# @see https://github.com/acquia/orca/blob/main/docs/understanding-orca.md#continuous-integration
orca-job:
- STATIC_CODE_ANALYSIS
- INTEGRATED_TEST_ON_OLDEST_SUPPORTED
- INTEGRATED_TEST_ON_PREVIOUS_MINOR
- INTEGRATED_TEST_ON_LATEST_LTS
# - INTEGRATED_UPGRADE_TEST_FROM_PREVIOUS_MINOR
- INTEGRATED_TEST_ON_CURRENT
# - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR
- ISOLATED_TEST_ON_CURRENT_DEV
- INTEGRATED_TEST_ON_CURRENT_DEV
- STRICT_DEPRECATED_CODE_SCAN
- ISOLATED_TEST_ON_NEXT_MINOR
- INTEGRATED_TEST_ON_NEXT_MINOR
# - ISOLATED_UPGRADE_TEST_TO_NEXT_MAJOR_BETA_OR_LATER
# - ISOLATED_UPGRADE_TEST_TO_NEXT_MAJOR_DEV
- DEPRECATED_CODE_SCAN_W_CONTRIB
- INTEGRATED_TEST_ON_NEXT_MINOR_DEV
- ISOLATED_TEST_ON_NEXT_MINOR_DEV
# - INTEGRATED_UPGRADE_TEST_TO_NEXT_MINOR_DEV
- LOOSE_DEPRECATED_CODE_SCAN
# The lowest version of PHP supported by all of Drupal, Acquia, and ORCA itself.
# @see https://www.drupal.org/docs/8/system-requirements/php-requirements
# @see https://docs.acquia.com/acquia-cloud/arch/tech-platform/
php-version: [ "8.1" , "8.3" ]
orca-enable-nightwatch: [ "FALSE" ]
orca-coverage-enable: [ "FALSE" ]
orca-version: [ "^4" ]
# When manually specifying a job to include, empty parameter values (such as for orca-job and php-version) may
# result in undefined behavior. Make sure to set each parameter explicitly.
include:
# Testing Drupal 10 in php 8.1 with nightwatch and coverage.
- orca-job: ISOLATED_TEST_ON_CURRENT
php-version: "8.1"
orca-enable-nightwatch: "TRUE"
# Testing coverage generation in Clover format when ORCA_COVERAGE_ENABLE is TRUE.
orca-coverage-enable: "TRUE"
# Testing Drupal 10 in php 8.3.
- orca-job: ISOLATED_TEST_ON_CURRENT
php-version: "8.3"
orca-enable-nightwatch: "TRUE"
# Testing coverage generation in CLOVER format.
orca-coverage-clover-enable: "TRUE"
# Testing Drupal 9 in php 8.1.
- orca-job: INTEGRATED_TEST_ON_LATEST_EOL_MAJOR
php-version: "8.1"
# Testing Drupal 11 in php 8.3.
- orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER
php-version: "8.3"
# Testing Drupal 11 in php 8.3.
- orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_BETA_OR_LATER
php-version: "8.3"
# Testing Drupal 11 in php 8.3.
- orca-job: ISOLATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV
php-version: "8.3"
# Testing Drupal 11 in php 8.3.
- orca-job: INTEGRATED_TEST_ON_NEXT_MAJOR_LATEST_MINOR_DEV
php-version: "8.3"
# ORCA only executes when ORCA_JOB is set. Leave ORCA_JOB unset to execute custom jobs.
# See ./bin/ci/example.sh for details.
# - php-version: "7.4"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
# Install ORCA and prepare the environment.
- name: Before install
run: |
composer create-project --no-dev acquia/orca ../orca "$ORCA_VERSION"
# Many customizations can be achieved with out-of-the-box features.
# @see https://github.com/acquia/orca/blob/develop/docs/advanced-usage.md
# As a last resort or to apply a yet-unreleased bug fix, you can patch ORCA here--but
# be aware that doing so will increase your maintenance burden and may cause ORCA to
# fail or miss problems it would otherwise have detected. Especially, do NOT use this
# approach to circumvent legitimate failures, which is likely to cause other company
# packages' builds to fail.
# curl http://example.com/my.patch | git -C ../orca apply
../orca/bin/ci/before_install.sh
# For custom testing needs, add your own scripts here. See ./bin/ci/example.sh for details.
# ./bin/ci/example.sh
# Create the test fixture and place the SUT.
- name: Install
run: ../orca/bin/ci/install.sh
# Display details about the fixture.
- name: Before script
run: ../orca/bin/ci/before_script.sh
# Run the test script.
- name: Script
run: ../orca/bin/ci/script.sh
# Perform final, post-script tasks.
- name: After script
run: ../orca/bin/ci/after_script.sh
# Conditionally send code coverage data.
- name: After success
if: ${{ success() }}
run: ../orca/bin/ci/after_success.sh
# Display debugging information in case of failure.
- name: After failure
if: ${{ failure() }}
run: ../orca/bin/ci/after_failure.sh
# Require all checks to pass without having to enumerate them in the branch protection UI.
# @see https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957
all-successful:
if: always()
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
- name: All checks successful
run: echo "🎉"