Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Drupal GitlabCI #24

Merged
merged 4 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################

include:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'

################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
variables:
SKIP_ESLINT: '1'
# Opt in to testing current minor against max supported PHP version.
OPT_IN_TEST_MAX_PHP: '1'
# Opt in to testing previous & next minor (Drupal 10.0.x and 10.2.x).
OPT_IN_TEST_PREVIOUS_MINOR: '1'
OPT_IN_TEST_NEXT_MINOR: '1'
# Opt in to testing $CORE_PREVIOUS_MAJOR (currently Drupal 9.5).
OPT_IN_TEST_PREVIOUS_MAJOR: '1'
# The 4.x branch of the CDN module requires PHP >=8.1, rather than core's >=7.4.
CORE_PREVIOUS_PHP_MIN: '8.1'
# Opt in to testing $CORE_MAJOR_DEVELOPMENT (currently Drupal 11).
OPT_IN_TEST_NEXT_MAJOR: '1'

# This module wants to strictly comply with Drupal's coding standards.
phpcs:
allow_failure: false
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- fix usage of deprecated getMockBuilder by createMock
- fix phpcs use statements should be sorted alphabetically - Issue #3373568 by nitin_lama, roshni27, aayushmankotia, Satish_kumar, wengerk
- add missing call to parent::setUp() on tests
- fix deprecation creation of dynamic property

### Added
- add Drupal GitlabCI

## [2.0.0] - 2022-12-16
### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Periodicity/MidnightResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Drupal\timesup\Periodicity;

use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Datetime\DrupalDateTime;

/**
* The midnight resolver which only apply once by day at midnight.
Expand Down
4 changes: 2 additions & 2 deletions src/Periodicity/PeriodicityBaseResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Drupal\timesup\Periodicity;

use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\timesup\Resolver\PeriodicityResolverInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\timesup\Resolver\PeriodicityResolverInterface;

/**
* Base class to run periodicity cache-tags invalidations.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/Resolver/ChainPeriodicityResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Drupal\Tests\timesup\Unit\Resolver;

use Drupal\timesup\Resolver\ChainPeriodicityResolver;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Tests\UnitTestCase;
use Drupal\timesup\Resolver\ChainPeriodicityResolver;

/**
* @coversDefaultClass \Drupal\timesup\Resolver\ChainPeriodicityResolver
Expand Down
38 changes: 37 additions & 1 deletion tests/src/Unit/Resolver/DailyResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Tests\timesup\Traits\InvokeMethodTrait;
use Drupal\timesup\Periodicity\DailyResolver;
use Drupal\Tests\UnitTestCase;
use Drupal\timesup\Periodicity\DailyResolver;

/**
* @coversDefaultClass \Drupal\timesup\Periodicity\DailyResolver
Expand All @@ -26,10 +26,46 @@ class DailyResolverTest extends UnitTestCase {
*/
protected $resolver;

/**
* The cache tags invalidator.
*
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
*/
protected $cacheTagsInvalidator;

/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;

/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

/**
* The logger channel factory service.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;

/**
* The time service.
*
* @var \Drupal\Component\Datetime\TimeInterface
*/
protected $time;

/**
* {@inheritdoc}
*/
public function setUp(): void {
parent::setUp();
$this->cacheTagsInvalidator = $this->createMock(CacheTagsInvalidatorInterface::class);

$this->state = $this->createMock(StateInterface::class);
Expand Down
38 changes: 37 additions & 1 deletion tests/src/Unit/Resolver/HourlyResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Tests\timesup\Traits\InvokeMethodTrait;
use Drupal\timesup\Periodicity\HourlyResolver;
use Drupal\Tests\UnitTestCase;
use Drupal\timesup\Periodicity\HourlyResolver;

/**
* @coversDefaultClass \Drupal\timesup\Periodicity\HourlyResolver
Expand All @@ -26,10 +26,46 @@ class HourlyResolverTest extends UnitTestCase {
*/
protected $resolver;

/**
* The cache tags invalidator.
*
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
*/
protected $cacheTagsInvalidator;

/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;

/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

/**
* The logger channel factory service.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;

/**
* The time service.
*
* @var \Drupal\Component\Datetime\TimeInterface
*/
protected $time;

/**
* {@inheritdoc}
*/
public function setUp(): void {
parent::setUp();
$this->cacheTagsInvalidator = $this->createMock(CacheTagsInvalidatorInterface::class);

$this->state = $this->createMock(StateInterface::class);
Expand Down
40 changes: 38 additions & 2 deletions tests/src/Unit/Resolver/MidnightResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Drupal\Tests\timesup\Unit\Resolver;

use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Tests\timesup\Traits\InvokeMethodTrait;
use Drupal\timesup\Periodicity\MidnightResolver;
use Drupal\Tests\UnitTestCase;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\timesup\Periodicity\MidnightResolver;

/**
* @coversDefaultClass \Drupal\timesup\Periodicity\MidnightResolver
Expand All @@ -27,10 +27,46 @@ final class MidnightResolverTest extends UnitTestCase {
*/
protected $resolver;

/**
* The cache tags invalidator.
*
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
*/
protected $cacheTagsInvalidator;

/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;

/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

/**
* The logger channel factory service.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;

/**
* The time service.
*
* @var \Drupal\Component\Datetime\TimeInterface
*/
protected $time;

/**
* {@inheritdoc}
*/
public function setUp(): void {
parent::setUp();
$this->cacheTagsInvalidator = $this->createMock(CacheTagsInvalidatorInterface::class);

$this->state = $this->createMock(StateInterface::class);
Expand Down
38 changes: 37 additions & 1 deletion tests/src/Unit/Resolver/MinutelyResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Tests\timesup\Traits\InvokeMethodTrait;
use Drupal\timesup\Periodicity\MinutelyResolver;
use Drupal\Tests\UnitTestCase;
use Drupal\timesup\Periodicity\MinutelyResolver;

/**
* @coversDefaultClass \Drupal\timesup\Periodicity\MinutelyResolver
Expand All @@ -26,10 +26,46 @@ class MinutelyResolverTest extends UnitTestCase {
*/
protected $resolver;

/**
* The cache tags invalidator.
*
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
*/
protected $cacheTagsInvalidator;

/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;

/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

/**
* The logger channel factory service.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;

/**
* The time service.
*
* @var \Drupal\Component\Datetime\TimeInterface
*/
protected $time;

/**
* {@inheritdoc}
*/
public function setUp(): void {
parent::setUp();
$this->cacheTagsInvalidator = $this->createMock(CacheTagsInvalidatorInterface::class);

$this->state = $this->createMock(StateInterface::class);
Expand Down
38 changes: 37 additions & 1 deletion tests/src/Unit/Resolver/WeeklyResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Tests\timesup\Traits\InvokeMethodTrait;
use Drupal\timesup\Periodicity\WeeklyResolver;
use Drupal\Tests\UnitTestCase;
use Drupal\timesup\Periodicity\WeeklyResolver;

/**
* @coversDefaultClass \Drupal\timesup\Periodicity\WeeklyResolver
Expand All @@ -26,10 +26,46 @@ class WeeklyResolverTest extends UnitTestCase {
*/
protected $resolver;

/**
* The cache tags invalidator.
*
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
*/
protected $cacheTagsInvalidator;

/**
* The state service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;

/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

/**
* The logger channel factory service.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;

/**
* The time service.
*
* @var \Drupal\Component\Datetime\TimeInterface
*/
protected $time;

/**
* {@inheritdoc}
*/
public function setUp(): void {
parent::setUp();
$this->cacheTagsInvalidator = $this->createMock(CacheTagsInvalidatorInterface::class);

$this->state = $this->createMock(StateInterface::class);
Expand Down
Loading