Skip to content

Commit 998d6cb

Browse files
committed
Add workflow to test Drush command E2E
1 parent e71d285 commit 998d6cb

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/php.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,65 @@ jobs:
207207
run: |
208208
cd ~/drupal
209209
./vendor/bin/phpstan analyze web/core/modules/dynamic_page_cache --debug
210+
211+
drush_command:
212+
needs:
213+
- lint
214+
- tests
215+
continue-on-error: ${{ matrix.experimental }}
216+
runs-on: "ubuntu-latest"
217+
name: "Drush command | PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal }}"
218+
strategy:
219+
matrix:
220+
experimental: [false]
221+
php-version:
222+
- "8.0"
223+
drupal:
224+
- "^9.0"
225+
include:
226+
- php-version: "8.1"
227+
drupal: "10.0.x-dev"
228+
experimental: true
229+
steps:
230+
- name: "Checkout"
231+
uses: "actions/checkout@v2"
232+
- name: "Install PHP"
233+
uses: "shivammathur/setup-php@v2"
234+
with:
235+
coverage: "none"
236+
php-version: "${{ matrix.php-version }}"
237+
tools: composer:v2
238+
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
239+
- name: Setup Drupal
240+
uses: bluehorndigital/[email protected]
241+
with:
242+
version: ${{ matrix.drupal }}
243+
path: ~/drupal
244+
- name: Add Drush to Drupal
245+
run: |
246+
cd ~/drupal
247+
composer require drush/drush
248+
- name: "set the version alias for self"
249+
run: |
250+
if [ "${{ github.event_name }}" == 'pull_request' ]; then
251+
echo ::set-output name=VERSION_ALIAS::dev-"${{ github.sha }}"
252+
else
253+
echo ::set-output name=VERSION_ALIAS::dev-main
254+
fi
255+
id: branch_alias
256+
- name: "require phpstan-drupal"
257+
run: |
258+
cd ~/drupal
259+
COMPOSER_MEMORY_LIMIT=-1 composer require mglaman/phpstan-drupal "${{ steps.branch_alias.outputs.VERSION_ALIAS }} as 1.1.99" phpstan/extension-installer --with-all-dependencies
260+
- name: "Install Drupal"
261+
run: |
262+
cd ~/drupal
263+
php vendor/bin/drush site-install --db-url=sqlite://sites/default/files/.ht.sqlite
264+
- name: "Generate PHPStan config"
265+
run: |
266+
cd ~/drupal
267+
php vendor/bin/drush phpstan:setup --file ../phpstan.neon
268+
- name: "Test core/install.php"
269+
run: |
270+
cd ~/drupal
271+
./vendor/bin/phpstan analyze web/core/install.php --debug

0 commit comments

Comments
 (0)