Skip to content

fixup! Rewrite github action with ddev. #14

fixup! Rewrite github action with ddev.

fixup! Rewrite github action with ddev. #14

Workflow file for this run

name: CI
on:
- push
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2]
composer-flags: ['']
drupal-constraint: ['^10.3.5']
steps:
- uses: actions/checkout@v4
- name: Setup DDEV
uses: ddev/github-action-setup-ddev@v1
with:
autostart: false
- name: Prepare DDEV project
# These instructions are based on:
# - https://github.com/ddev/ddev-drupal-contrib
# - https://github.com/ddev/ddev-selenium-standalone-chrome
# - Additional commands to prepare composer.json before install.
run: |
set -x
ddev config --project-type=drupal --docroot=web --php-version=${{ matrix.php }} --project-name=collabora-drupal
ddev get ddev/ddev-drupal-contrib
ddev get ddev/ddev-selenium-standalone-chrome
- run: ddev start
- name: Prepare composer.json
run: |
# Require additional Composer packages.
ddev composer require --no-update --dev drush/drush
# Avoid composer/installers v1 with '--prefer-lowest'.
composer require --no-update --dev composer/installers:^2
# Avoid open-telemetry/sdk beta version with '--prefer-lowest'.
composer require --no-update --dev open-telemetry/sdk:@stable
# Set 'allow-plugins'.
composer config --no-plugins allow-plugins.php-http/discovery false
# Report on composer.json changes.
git diff composer.json
# Let ddev-drupal-contrib require additional packages.
ddev expand-composer-json
# Report on composer.json changes.
git diff composer.json
- name: Run composer install and symlink-project
run: |
# Apply composer flags like '--prefer-lowest'.
ddev composer update --no-install ${{ matrix.composer-flags }}
# Install dependencies.
ddev composer install --no-interaction
# Symlink the module files to web/modules/custom/collabora_drupal/*.
ddev symlink-project
- name: Update Drupal and PHP version from project files.
run: |
# Report on PHP and Drupal versions before.
ddev php --version
ddev composer info | grep "drupal/core "
# Update from project files.
ddev config --update
ddev restart
# Report on PHP and Drupal versions after.
ddev php --version
ddev composer info | grep "drupal/core "
- run: ddev phpunit