Skip to content

Commit

Permalink
Update actions to run Drupal 10
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Nov 22, 2024
1 parent a53c32e commit a5faeac
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,30 @@ jobs:
run: |
# We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage)
# Install Drupal
composer --no-interaction create-project drupal/recommended-project:^9 --stability=dev drupal
composer --no-interaction create-project drupal/recommended-project:^10 --stability=dev drupal
# Copy our module source code into the Drupal module folder.
mkdir -p drupal/web/modules/contrib/os2forms_get_organized
cp -r os2forms_get_organized.* composer.json src drupal/web/modules/contrib/os2forms_get_organized
# Allow all plugins
composer --working-dir=drupal config --no-plugins allow-plugins true
# Add our module as a composer repository.
composer --no-interaction --working-dir=drupal config repositories.os2forms/os2forms_get_organized path web/modules/contrib/os2forms_get_organized
composer --working-dir=drupal --no-interaction config --append repositories.os2forms/os2forms_get_organized path web/modules/contrib/os2forms_get_organized
# Restore Drupal composer repository.
composer --no-interaction --working-dir=drupal config repositories.drupal composer https://packages.drupal.org/8
composer --no-interaction --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true
composer --no-interaction --working-dir=drupal config --no-plugins allow-plugins.zaporylie/composer-drupal-optimizations true
composer --no-interaction --working-dir=drupal config --no-plugins allow-plugins.simplesamlphp/composer-module-installer true
# @see https://getcomposer.org/doc/03-cli.md#modifying-extra-values
composer --no-interaction --working-dir=drupal config --no-plugins --json extra.enable-patching true
# Make Drupal 10 compatible
composer --working-dir=drupal --no-interaction require psr/http-message:^1.0
composer --working-dir=drupal --no-interaction require 'mglaman/composer-drupal-lenient'
composer --working-dir=drupal config --no-plugins --merge --json extra.drupal-lenient.allowed-list '["drupal/coc_forms_auto_export", "drupal/webform_node_element"]'
# Require our module.
composer --no-interaction --working-dir=drupal require 'os2forms/os2forms_get_organized:*'
composer --working-dir=drupal --no-interaction require 'os2forms/os2forms_get_organized:*'
# Check code
composer --no-interaction --working-dir=drupal require --dev drupal/core-dev
composer --working-dir=drupal --no-interaction require --dev drupal/core-dev
cd drupal/web/modules/contrib/os2forms_get_organized
# Remove our non-dev dependencies to prevent duplicated Drupal installation
# PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_get_organized/os2forms_get_organized/drupal/web/modules/contrib/os2forms_get_organized/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_get_organized/os2forms_get_organized/drupal/web/core/includes/bootstrap.inc on line 190
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ about writing changes to this log.

## [Unreleased]

* Added audit logging.

## [1.2.0] 05.07.2024

* Drupal 10 compatibility
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"os2forms/os2forms": "^3.17"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"drupal/coder": "^8.3",
"mglaman/drupal-check": "^1.4"
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"mglaman/drupal-check": "^1.4",
"mglaman/phpstan-drupal": "~1.2.0"
},
"scripts": {
"code-analysis/drupal-check": [
Expand Down Expand Up @@ -55,7 +56,8 @@
"dealerdirect/phpcodesniffer-composer-installer": true,
"zaporylie/composer-drupal-optimizations": true,
"cweagans/composer-patches": true,
"simplesamlphp/composer-module-installer": true
"simplesamlphp/composer-module-installer": true,
"mglaman/composer-drupal-lenient": true
}
}
}
6 changes: 3 additions & 3 deletions src/Plugin/AdvancedQueue/JobType/ArchiveDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Drupal\os2forms_get_organized\Plugin\AdvancedQueue\JobType;

use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase;
use Drupal\os2forms_get_organized\Helper\ArchiveHelper;
use Drupal\webform\Entity\WebformSubmission;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/WebformHandler/GetOrganizedWebformHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Drupal\os2forms_get_organized\Plugin\WebformHandler;

use Drupal\advancedqueue\Job;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\advancedqueue\Job;
use Drupal\os2forms_get_organized\Plugin\AdvancedQueue\JobType\ArchiveDocument;
use Drupal\webform\Plugin\WebformHandlerBase;
use Drupal\webform\WebformSubmissionConditionsValidatorInterface;
Expand Down

0 comments on commit a5faeac

Please sign in to comment.