Skip to content

Commit 58b7b03

Browse files
committed
Add testing for D10
1 parent ca1cd63 commit 58b7b03

File tree

3 files changed

+47
-30
lines changed

3 files changed

+47
-30
lines changed

.circleci/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ jobs:
9797
- run:
9898
name: Global - Run against a file
9999
command: |
100-
drupal-check /tmp/drupal/core/install.php
100+
drupal-check -vvv /tmp/drupal/core/install.php
101101
- run:
102102
name: Global - Run against a module
103103
command: |
104-
drupal-check /tmp/drupal/core/modules/dynamic_page_cache
104+
drupal-check -vvv /tmp/drupal/core/modules/dynamic_page_cache
105105
test_drupal_project:
106106
<<: *defaults
107107
steps:
@@ -111,11 +111,11 @@ jobs:
111111
- run:
112112
name: Global - Run against a file
113113
command: |
114-
drupal-check /tmp/drupal/web/core/install.php
114+
drupal-check -vvv /tmp/drupal/web/core/install.php
115115
- run:
116116
name: Global - Run against a module
117117
command: |
118-
drupal-check /tmp/drupal/web/core/modules/dynamic_page_cache
118+
drupal-check -vvv /tmp/drupal/web/core/modules/dynamic_page_cache
119119
test_drupal_local_require:
120120
<<: *defaults
121121
steps:
@@ -152,7 +152,7 @@ jobs:
152152
- run:
153153
name: Phar - Run against a module
154154
command: |
155-
drupal-check /tmp/drupal/web/modules/contrib/ctools || if (($? == 255)); then false; else true; fi
155+
drupal-check -vvv /tmp/drupal/web/modules/contrib/ctools || if (($? == 255)); then false; else true; fi
156156
test_global_require_with_drush:
157157
<<: *defaults
158158
steps:
@@ -166,11 +166,11 @@ jobs:
166166
- run:
167167
name: Run against a file
168168
command: |
169-
drupal-check /tmp/drupal/web/core/install.php
169+
drupal-check -vvv /tmp/drupal/web/core/install.php
170170
- run:
171171
name: Run against a module
172172
command: |
173-
drupal-check /tmp/drupal/web/core/modules/dynamic_page_cache
173+
drupal-check -vvv /tmp/drupal/web/core/modules/dynamic_page_cache
174174
test_contained_not_initialized:
175175
<<: *defaults
176176
steps:
@@ -184,7 +184,7 @@ jobs:
184184
- run:
185185
name: Phar - Run against a file
186186
command: |
187-
drupal-check /tmp/drupal/web/modules/contained_not_initialized -vvv
187+
drupal-check -vvv /tmp/drupal/web/modules/contained_not_initialized -vvv
188188
workflows:
189189
version: 2
190190
test_and_deploy:

.github/workflows/php.yml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ on:
77
branches: [main]
88

99
jobs:
10+
lint:
11+
runs-on: "ubuntu-latest"
12+
strategy:
13+
matrix:
14+
experimental: [false]
15+
php-version:
16+
- "7.4"
17+
- "8.0"
18+
- "8.1"
19+
steps:
20+
- name: "Checkout"
21+
uses: "actions/checkout@v2"
22+
- name: "Install PHP"
23+
uses: "shivammathur/setup-php@v2"
24+
with:
25+
coverage: "none"
26+
php-version: "${{ matrix.php-version }}"
27+
tools: composer:v2
28+
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate --strict
31+
- name: "Install dependencies"
32+
run: "composer install --no-progress --prefer-dist"
33+
- name: "PHPCS"
34+
run: "php vendor/bin/phpcs src"
35+
# - name: "PHPStan"
36+
# run: "php vendor/bin/phpstan analyze src"
1037
tests:
1138
continue-on-error: ${{ matrix.experimental }}
1239
runs-on: "ubuntu-latest"
@@ -15,18 +42,17 @@ jobs:
1542
matrix:
1643
experimental: [false]
1744
php-version:
18-
- "7.3"
1945
- "7.4"
2046
drupal:
2147
- "^8.9"
2248
- "^9.0"
2349
include:
24-
- php-version: "7.2"
25-
drupal: "~8.9"
26-
experimental: false
2750
- php-version: "8.0"
2851
drupal: "^9.0"
29-
experimental: true
52+
experimental: false
53+
- php-version: "8.0"
54+
drupal: "10.0.x-dev"
55+
experimental: false
3056
steps:
3157
- name: "Checkout"
3258
uses: "actions/checkout@v2"
@@ -37,18 +63,8 @@ jobs:
3763
php-version: "${{ matrix.php-version }}"
3864
tools: composer:v2
3965
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
40-
- name: Validate composer.json and composer.lock
41-
run: composer validate --strict
42-
- name: "Install dependencies"
43-
run: "composer install --no-progress --prefer-dist"
44-
- name: "PHPCS"
45-
run: "php vendor/bin/phpcs src"
46-
# - name: "PHPStan"
47-
# run: "php vendor/bin/phpstan analyze src"
48-
- name: Remove vendor directory for integration testing
49-
run: rm -rf vendor
5066
- name: Setup Drupal
51-
uses: bluehorndigital/[email protected].1
67+
uses: bluehorndigital/[email protected].3
5268
with:
5369
version: ${{ matrix.drupal }}
5470
path: ~/drupal
@@ -92,7 +108,7 @@ jobs:
92108
tools: composer:v2
93109
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
94110
- name: Setup Drupal
95-
uses: bluehorndigital/[email protected].1
111+
uses: bluehorndigital/[email protected].3
96112
with:
97113
version: ${{ matrix.drupal }}
98114
path: ~/drupal

src/Command/CheckCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
202202
$output->writeln('<comment>Assumed running as global dependency</comment>', OutputInterface::VERBOSITY_DEBUG);
203203
$phpstanBin = \realpath(__DIR__ . '/../../../../phpstan/phpstan/phpstan.phar');
204204
$configuration_data['parameters']['bootstrapFiles'] = [\realpath(__DIR__ . '/../../error-bootstrap.php')];
205-
// The phpstan/extension-installer doesn't seem to register.
206-
$configuration_data['includes'] = [
207-
\realpath(__DIR__ . '/../../../../phpstan/phpstan-deprecation-rules/rules.neon'),
208-
\realpath(__DIR__ . '/../../../../mglaman/phpstan-drupal/extension.neon'),
209-
];
205+
if (!class_exists('PHPStan\ExtensionInstaller\GeneratedConfig')) {
206+
$configuration_data['includes'] = [
207+
\realpath(__DIR__ . '/../../../../phpstan/phpstan-deprecation-rules/rules.neon'),
208+
\realpath(__DIR__ . '/../../../../mglaman/phpstan-drupal/extension.neon'),
209+
];
210+
}
210211
} else {
211212
throw new ShouldNotHappenException('Could not determine if local or global installation');
212213
}

0 commit comments

Comments
 (0)