-
Notifications
You must be signed in to change notification settings - Fork 36
136 lines (117 loc) · 5.41 KB
/
Copy pathphp.yml
File metadata and controls
136 lines (117 loc) · 5.41 KB
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
name: test_and_lint
env:
SIMPLETEST_DB: "sqlite://localhost//tmp/test.sqlite"
SIMPLETEST_BASE_URL: "http://127.0.0.1:8000"
APIGEE_EDGE_AUTH_TYPE: ${{ secrets.APIGEE_EDGE_AUTH_TYPE }}
APIGEE_EDGE_ORGANIZATION: ${{ secrets.APIGEE_EDGE_ORGANIZATION }}
APIGEE_EDGE_USERNAME: ${{ secrets.APIGEE_EDGE_USERNAME }}
APIGEE_EDGE_PASSWORD: ${{ secrets.APIGEE_EDGE_PASSWORD }}
APIGEE_EDGE_INSTANCE_TYPE: ${{ secrets.APIGEE_EDGE_INSTANCE_TYPE }}
APIGEE_INTEGRATION_ENABLE: ${{ secrets.APIGEE_INTEGRATION_ENABLE }}
APIGEE_EDGE_ENDPOINT: ${{ secrets.APIGEE_EDGE_ENDPOINT }}
SYMFONY_DEPRECATIONS_HELPER: "disabled"
BROWSERTEST_OUTPUT_DIRECTORY: "sites/simpletest/browser_output"
BROWSERTEST_OUTPUT_BASE_URL: ""
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", { "chromeOptions": { "w3c": false } }, "http://127.0.0.1:9515/wd/hub"]'
on:
push:
pull_request_target:
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
name: "PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal-core }}"
strategy:
fail-fast: false
matrix:
experimental: [false]
php-version:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
drupal-core:
# Should update the following as the minimum supported version from Drupal.org
- "10.6.x"
- "11.3.x"
exclude:
- php-version: "8.2"
drupal-core: "11.3.x"
- php-version: "8.5"
drupal-core: "10.6.x"
steps:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
extensions: date, dom, filter, hash, json, curl, libxml, mbstring, zip, pdo, sqlite3, mysqli, mysql, pdo_mysql, bcmath, gd, exif, iconv, opcache, imagick, openssl
- name: Checkout Drupal core
run: |
git clone --depth 1 --branch ${{ matrix.drupal-core }} https://github.com/drupal/drupal.git drupal
mkdir -p drupal/profiles/contrib/apigee_devportal_kickstart
mkdir -p drupal/sites/simpletest/browser_output
- name: Checkout apigee_devportal_kickstart distribution
uses: actions/checkout@v4
with:
path: drupal/profiles/contrib/apigee_devportal_kickstart
- name: "Allow plugins and dev dependencies"
run: |
cd drupal
composer require "justinrainbow/json-schema:^6.5.1" --no-update
composer config --no-plugins allow-plugins.composer/installers true
composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
composer config --no-plugins allow-plugins.drupal/core-project-message true
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-plugins allow-plugins.wikimedia/composer-merge-plugin true
composer config --no-plugins allow-plugins.composer/package-versions-deprecated true
composer config --no-plugins allow-plugins.cweagans/composer-patches true
composer config --no-plugins allow-plugins.php-http/discovery true
composer config minimum-stability dev
composer require wikimedia/composer-merge-plugin
composer config --json extra.merge-plugin.require '["profiles/contrib/apigee_devportal_kickstart/composer.json"]'
composer config platform.php ${{ matrix.php-version }}
# Drupal 10 still has Forum and Tour in core.
if [[ "${{ matrix.drupal-core }}" == 10.* ]]; then
jq '.replace += {"drupal/forum": "*", "drupal/tour": "*"}' composer.json > tmp.json && mv tmp.json composer.json
fi
# We must prevent the contrib Forum module from trying to download the contrib History module.
jq '.replace += {"drupal/history": "*"}' composer.json > tmp.json && mv tmp.json composer.json
composer update --with-all-dependencies
composer require --dev phpspec/prophecy-phpunit:^2
# Install drupal using minimal installation profile and enable the module.
- name: Install Drupal
run: |
cd drupal
php -d sendmail_path=$(which true); vendor/bin/drush --yes -v site-install minimal --db-url="$SIMPLETEST_DB"
vendor/bin/drush en apigee_edge -y
vendor/bin/drush rs 8000 &
- name: "PHPCS"
run: |
cd drupal
cp profiles/contrib/apigee_devportal_kickstart/phpcs.xml.dist .
vendor/bin/phpcs --standard=./phpcs.xml.dist profiles/contrib/apigee_devportal_kickstart -p -s -n --colors
- name: "PHPUnit unit"
run: |
cd drupal
vendor/bin/phpunit -c core --color --testsuite unit profiles/contrib/apigee_devportal_kickstart
- name: "PHPUnit kernel"
run: |
cd drupal
vendor/bin/phpunit -c core --color --testsuite kernel profiles/contrib/apigee_devportal_kickstart
- uses: nanasess/setup-chromedriver@v2
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- name: "PHPUnit functional javascript"
run: |
cd drupal
vendor/bin/phpunit -c core --color --testsuite functional-javascript profiles/contrib/apigee_devportal_kickstart
- name: "PHPUnit functional"
run: |
cd drupal
vendor/bin/phpunit -c core --color --testsuite functional profiles/contrib/apigee_devportal_kickstart