Skip to content

Issue 47: Patch groupmedia 3 and 4 in github action, to avoid error i… #139

Issue 47: Patch groupmedia 3 and 4 in github action, to avoid error i…

Issue 47: Patch groupmedia 3 and 4 in github action, to avoid error i… #139

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.1, 8.2, 8.3]
drupal-constraint: ['^10.3.5', '^11.0.5']
exclude:
- php: 8.1
drupal-constraint: '^11.0.5'
- php: 8.2
drupal-constraint: '^11.0.5'
steps:
- uses: actions/checkout@v4
- name: Prepare docker-compose
run: |
set -x
# Set the php version in docker-compose.yml.
sed -i -e 's/httpd-php-dev:8.[0-9]/httpd-php-dev:${{ matrix.php }}/g' docker-compose.yml
# Report what was changed.
git diff
- name: Install docker-compose
run: |
set -x
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start docker-compose
run: |
docker-compose up -d
- name: Tune the container
run: |
set -x
# Report before.
docker-compose exec -T web php --version
docker-compose exec -T web php --info | grep xdebug.mode
# Disable xdebug.
docker-compose exec -T web phpdismod xdebug
# Restart the web server.
docker-compose exec -T web /etc/init.d/php${{ matrix.php }}-fpm restart
# Report after.
docker-compose exec -T web php --version
docker-compose exec -T web php --info | grep xdebug.mode || true
- name: Prepare composer.json
run: |
set -x
# Require a specific Drupal core version.
docker-compose exec -T web composer require --no-update --dev drupal/core:${{ matrix.drupal-constraint }}
# Apply patches.
docker-compose exec -T web composer config --json "extra.patches.drupal/group" '{"Using a translatable string as a category for field type is deprecated - https://www.drupal.org/project/group/issues/3458530": "https://www.drupal.org/files/issues/2024-07-02/group-translate-string-as-category-is-deprecated_0.patch"}'
docker-compose exec -T web composer config --json "extra.patches.drupal/groupmedia" '{"Remove the 'default_argument_skip_url' setting in views.view.group_media.yml - https://www.drupal.org/project/groupmedia/issues/3491778": "https://www.drupal.org/files/issues/2024-12-04/groupmedia-4.x-3491778-remove-default_argument_skip_url.patch"}'
docker-compose exec -T web composer config allow-plugins.cweagans/composer-patches true
docker-compose exec -T web composer require --dev --no-update cweagans/composer-patches
- name: Composer install
run: |
docker-compose exec -T web composer install --no-interaction
- name: PhpCS
run: |
docker-compose exec -T web ./vendor/bin/phpcs -s
- name: Generate proof key
run: |
set -x
docker-compose exec -T collabora coolconfig generate-proof-key
# Collabora becomes unavailable after the above command.
docker-compose restart collabora
- name: Drupal site install
run: |
docker-compose exec -T web ./vendor/bin/run drupal:site-install
- name: PhpUnit
run: |
docker-compose exec -T web ./vendor/bin/phpunit
- name: PhpUnit - groupmedia 3
run: |
# Replace the patch, then install the 3.x version of groupmedia.
docker-compose exec -T web composer config --json "extra.patches.drupal/groupmedia" '{"Remove the 'default_argument_skip_url' setting in views.view.group_media.yml - https://www.drupal.org/project/groupmedia/issues/3491778": "https://www.drupal.org/files/issues/2024-12-04/groupmedia-3.x-3491778-remove-default_argument_skip_url.patch"}'
docker-compose exec -T web composer require --dev drupal/groupmedia:^3 -W
docker-compose exec -T web ./vendor/bin/phpunit --testsuite "Collabora Online Group"