Skip to content

Commit

Permalink
drop support of drupal below 9.5.x & add support of Drupal 10.1/10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Apr 9, 2024
1 parent 8bb777e commit c87ba20
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 77 deletions.
68 changes: 29 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,49 @@ on:
jobs:
tests:
name: Tests

runs-on: ubuntu-latest

strategy:
matrix:
drupal_version: ['9.4', '9.5', '10.0']
drupal_version: ['9.5', '10.0', '10.1', '10.2']
module: [ 'backerymails' ]
experimental: [ false ]

steps:
- uses: actions/checkout@v3
- run: docker-compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker-compose stack
run: docker-compose -f docker-compose.yml build --pull --build-arg BASE_IMAGE_TAG=${{ matrix.drupal_version }} drupal
- uses: actions/checkout@v4
- run: docker compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker compose stack
run: docker compose -f docker-compose.yml build --pull --build-arg BASE_IMAGE_TAG=${{ matrix.drupal_version }} drupal
- name: Up a persistent Docker Container
run: docker-compose -f docker-compose.yml up -d drupal
run: docker compose -f docker-compose.yml up -d drupal
- name: wait on Docker to be ready, especially Apache that takes many seconds to be up
run: docker-compose exec -T drupal wait-for-it drupal:80 -t 60
run: docker compose exec -T drupal wait-for-it drupal:80 -t 60
- name: wait on Docker to be ready, especially MariaDB that takes many seconds to be up
run: docker-compose exec -T drupal wait-for-it db:3306 -t 60
run: docker compose exec -T drupal wait-for-it db:3306 -t 60
- name: Run unit tests
run: docker-compose -f docker-compose.yml exec -T -u www-data drupal phpunit --no-coverage --group=${{ matrix.module }} --exclude-group=${{ matrix.module }}_functional --configuration=/var/www/html/phpunit.xml
continue-on-error: ${{ matrix.experimental }}
run: docker compose -f docker-compose.yml exec -T -u www-data drupal phpunit --no-coverage --group=${{ matrix.module }} --exclude-group=${{ matrix.module }}_functional --configuration=/var/www/html/phpunit.xml

tests-functional:
name: Functional Tests

runs-on: ubuntu-latest

strategy:
matrix:
drupal_version: ['9.4', '9.5', '10.0']
drupal_version: ['9.5', '10.0', '10.1', '10.2']
module: [ 'backerymails' ]
experimental: [ false ]

steps:
- uses: actions/checkout@v3
- run: docker-compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker-compose stack
run: docker-compose -f docker-compose.yml build --pull --build-arg BASE_IMAGE_TAG=${{ matrix.drupal_version }} drupal
continue-on-error: ${{ matrix.experimental }}
- uses: actions/checkout@v4
- run: docker compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker compose stack
run: docker compose -f docker-compose.yml build --pull --build-arg BASE_IMAGE_TAG=${{ matrix.drupal_version }} drupal
- name: Up a persistent Docker Container
run: docker-compose -f docker-compose.yml up -d drupal
run: docker compose -f docker-compose.yml up -d drupal
- name: wait on Docker to be ready, especially Apache that takes many seconds to be up
run: docker-compose exec -T drupal wait-for-it drupal:80 -t 60
run: docker compose exec -T drupal wait-for-it drupal:80 -t 60
- name: wait on Docker to be ready, especially MariaDB that takes many seconds to be up
run: docker-compose exec -T drupal wait-for-it db:3306 -t 60
run: docker compose exec -T drupal wait-for-it db:3306 -t 60
- name: Bootstrap Drupal
run: docker-compose -f docker-compose.yml exec -T -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" -y
continue-on-error: ${{ matrix.experimental }}
run: docker compose -f docker-compose.yml exec -T -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" -y
- name: Run tests
run: docker-compose -f docker-compose.yml exec -T -u www-data drupal phpunit --no-coverage --group=${{ matrix.module }}_functional --configuration=/var/www/html/phpunit.xml
continue-on-error: ${{ matrix.experimental }}
run: docker compose -f docker-compose.yml exec -T -u www-data drupal phpunit --no-coverage --group=${{ matrix.module }}_functional --configuration=/var/www/html/phpunit.xml

upgrade-status:
name: Upgrade Status
Expand All @@ -71,21 +61,21 @@ jobs:
module: ['backerymails']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- run: docker-compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker-compose stack
run: docker-compose -f docker-compose.yml build --pull --build-arg BASE_IMAGE_TAG=${{ matrix.drupal_version }} drupal
- run: docker compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker compose stack
run: docker compose -f docker-compose.yml build --pull --build-arg BASE_IMAGE_TAG=${{ matrix.drupal_version }} drupal
- name: Up a persistent Docker Container
run: docker-compose -f docker-compose.yml up -d drupal
run: docker compose -f docker-compose.yml up -d drupal
- name: Add upgrade status dependency
run: docker-compose exec -T drupal wait-for-it db:3306 -- composer require --dev drupal/upgrade_status --no-interaction
run: docker compose exec -T drupal wait-for-it db:3306 -- composer require --dev drupal/upgrade_status --no-interaction
- name: Bootstrap Drupal
run: docker-compose -f docker-compose.yml exec -T -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" -y
run: docker compose -f docker-compose.yml exec -T -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" -y
- name: Enable upgrade status
run: docker-compose exec -T drupal wait-for-it db:3306 -- ./vendor/bin/drush en upgrade_status -y
run: docker compose exec -T drupal wait-for-it db:3306 -- ./vendor/bin/drush en upgrade_status -y
- name: Enable the module
run: docker-compose exec -T drupal wait-for-it db:3306 -- ./vendor/bin/drush en ${{ matrix.module }} -y
run: docker compose exec -T drupal wait-for-it db:3306 -- ./vendor/bin/drush en ${{ matrix.module }} -y
- name: Run upgrade status
run: docker-compose exec -T drupal wait-for-it db:3306 -- ./vendor/bin/drush upgrade_status:analyze ${{ matrix.module }}
run: docker compose exec -T drupal wait-for-it db:3306 -- ./vendor/bin/drush upgrade_status:analyze ${{ matrix.module }}
28 changes: 14 additions & 14 deletions .github/workflows/styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v1
- uses: actions/checkout@v3
tools: cs2pr, composer:v2
- uses: actions/checkout@v4
- run: composer install --prefer-dist
- run: ./vendor/bin/phpcs ./ --report=checkstyle | cs2pr

Expand All @@ -23,10 +23,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v1, phpmd
- uses: actions/checkout@v3
tools: cs2pr, composer:v2, phpmd
- uses: actions/checkout@v4
- run: composer install --prefer-dist
- run: phpmd ./ text ./phpmd.xml --suffixes php,module,inc,install,test,profile,theme,css,info,txt --exclude *Test.php,*vendor/*

Expand All @@ -37,20 +37,20 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v1, phpcpd
- uses: actions/checkout@v3
tools: cs2pr, composer:v2, phpcpd
- uses: actions/checkout@v4
- run: composer install --prefer-dist
- run: phpcpd ./src --suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/

phpdd:
name: PhpDeprecationDetector (phpdd)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker-compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker-compose stack
run: docker-compose -f docker-compose.yml build drupal
- uses: actions/checkout@v4
- run: docker compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker compose stack
run: docker compose -f docker-compose.yml build drupal
- name: Run phpdd
run: docker-compose run drupal phpdd ./web/modules/contrib/backerymails/ --file-extensions php,module,inc,install,test,profile,theme,info --exclude vendor
run: docker compose run drupal phpdd ./web/modules/contrib/backerymails/ --file-extensions php,module,inc,install,test,profile,theme,info --exclude vendor
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [3.0.0] - 2023-03-17
### Removed
- drop support of drupal below 9.4.x
- drop support of drupal below 9.5.x
- remove tests condition to maintain compatibility below Drupal 9.2

### Added
- add dependabot for Github Action dependency
- add official support of drupal 9.5 & 10.0
- add coverage Drupal 10.1
- add coverage Drupal 10.2

### Changed
- re-enable PHPUnit Symfony Deprecation notice
Expand Down
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ globally on your environment:
* drush
* Latest dev release of Drupal 8.x/9.x/10.x.
* docker
* docker-compose
* docker compose

### Project bootstrap

Once run, you will be able to access to your fresh installed Drupal on `localhost::8888`.

docker-compose build --pull --build-arg BASE_IMAGE_TAG=9.5 drupal
docker compose build --pull --build-arg BASE_IMAGE_TAG=10.2 drupal
(get a coffee, this will take some time...)
docker-compose up -d drupal
docker-compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y
docker compose up -d drupal
docker compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y

# You may be interesed by reseting the admin passowrd of your Docker and install the module using those cmd.
docker-compose exec drupal drush user:password admin admin
docker-compose exec drupal drush en backerymails
docker compose exec drupal drush user:password admin admin
docker compose exec drupal drush en backerymails

## 🏆 Tests

We use the [Docker for Drupal Contrib images](https://hub.docker.com/r/wengerk/drupal-for-contrib) to run testing on our project.

Run testing by stopping at first failure using the following command:

docker-compose exec -u www-data drupal phpunit --group=backerymails --no-coverage --stop-on-failure --configuration=/var/www/html/phpunit.xml
docker compose exec -u www-data drupal phpunit --group=backerymails --no-coverage --stop-on-failure --configuration=/var/www/html/phpunit.xml

## 🚔 Check Drupal coding standards & Drupal best practices

Expand All @@ -64,7 +64,7 @@ The following Analyzer will be downloaded & installed as PHAR:

./scripts/hooks/post-commit
# or run command on the container itself
docker-compose exec drupal bash
docker compose exec drupal bash

#### Running Code Sniffer Drupal & DrupalPractice

Expand All @@ -76,13 +76,13 @@ violations.
PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

```
$ docker-compose exec drupal ./vendor/bin/phpcs ./web/modules/contrib/backerymails/
$ docker compose exec drupal ./vendor/bin/phpcs ./web/modules/contrib/backerymails/
```

Automatically fix coding standards

```
$ docker-compose exec drupal ./vendor/bin/phpcbf ./web/modules/contrib/backerymails/
$ docker compose exec drupal ./vendor/bin/phpcbf ./web/modules/contrib/backerymails/
```

#### Running PHP Mess Detector
Expand All @@ -92,7 +92,7 @@ https://github.com/phpmd/phpmd
Detect overcomplicated expressions & Unused parameters, methods, properties.

```
$ docker-compose exec drupal phpmd ./web/modules/contrib/backerymails/ text ./phpmd.xml \
$ docker compose exec drupal phpmd ./web/modules/contrib/backerymails/ text ./phpmd.xml \
--suffixes php,module,inc,install,test,profile,theme,css,info,txt --exclude *Test.php,*vendor/*
```

Expand All @@ -103,7 +103,7 @@ https://github.com/sebastianbergmann/phpcpd
`phpcpd` is a Copy/Paste Detector (CPD) for PHP code.

```
$ docker-compose exec drupal phpcpd ./web/modules/contrib/backerymails/src --suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/
$ docker compose exec drupal phpcpd ./web/modules/contrib/backerymails/src --suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/
```

#### Running PhpDeprecationDetector
Expand All @@ -113,7 +113,7 @@ https://github.com/wapmorgan/PhpDeprecationDetector
A scanner that checks compatibility of your code with PHP interpreter versions.

```
$ docker-compose exec drupal phpdd ./web/modules/contrib/backerymails/ \
$ docker compose exec drupal phpdd ./web/modules/contrib/backerymails/ \
--file-extensions php,module,inc,install,test,profile,theme,info --exclude vendor
```

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE_TAG=9.4
ARG BASE_IMAGE_TAG=10.2
FROM wengerk/drupal-for-contrib:${BASE_IMAGE_TAG}

ENV COMPOSER_MEMORY_LIMIT=-1
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Save every going out mails.

| Travis-CI | Style-CI | Downloads | Releases |
|:----------------------:|:-----------------------:|:-----------------------:|:------------------------:|
| [![Build Status](https://github.com/antistatique/drupal-backerymails/actions/workflows/ci.yml/badge.svg)](https://github.com/antistatique/drupal-backerymails/actions/workflows/ci.yml) | [![Code styles](https://github.com/antistatique/drupal-backerymails/actions/workflows/styles.yml/badge.svg)](https://github.com/antistatique/drupal-backerymails/actions/workflows/styles.yml) | [![Downloads](https://img.shields.io/badge/downloads-8.x--1.x-green.svg?style=flat-square)](https://ftp.drupal.org/files/projects/backerymails-8.x-1.x-dev.tar.gz) | [![Latest Stable Version](https://img.shields.io/badge/release-v1.3.x--dev-blue.svg?style=flat-square)](https://www.drupal.org/project/backerymails/releases) |

Backerymails is awesome because it merges every must-have features about mails such as :

- Save every going out mails using the MailManagerInterface & provides a user interface to retrieve them
Expand Down
2 changes: 1 addition & 1 deletion backerymails.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Backery Mails
description: 'Save every going out mails using the MailManagerInterface & provides a user interface to retrieve them.'
package: 'Mail'
type: module
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^9.5 || ^10

dependencies:
- drupal:views
Expand Down
8 changes: 4 additions & 4 deletions scripts/hooks/post-commit
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
echo "\n🚔 \033[0;32mRunning Code Sniffer Drupal & DrupalPractice for ./web/modules/contrib/backerymails/ ...\033[0m"
docker-compose exec drupal ./vendor/bin/phpcs ./web/modules/contrib/backerymails/
docker compose exec drupal ./vendor/bin/phpcs ./web/modules/contrib/backerymails/

echo "\n💩 \033[0;32mRunning PHP Mess Detector ...\033[0m"
docker-compose exec drupal phpmd ./web/modules/contrib/backerymails/ text ./phpmd.xml --suffixes php,module,inc,install,test,profile,theme,css,info,txt --exclude *Test.php,*vendor/*
docker compose exec drupal phpmd ./web/modules/contrib/backerymails/ text ./phpmd.xml --suffixes php,module,inc,install,test,profile,theme,css,info,txt --exclude *Test.php,*vendor/*

echo "\n🛂 \033[0;32mRunning PHP Copy/Paste Detector ...\033[0m"
docker-compose exec drupal phpcpd ./web/modules/contrib/backerymails/src --suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/
docker compose exec drupal phpcpd ./web/modules/contrib/backerymails/src --suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/

echo "\n🍫 \033[0;32mRunning PhpDeprecationDetector ...\033[0m"
docker-compose exec drupal phpdd ./web/modules/contrib/backerymails/ --file-extensions php,module,inc,install,test,profile,theme,info --exclude vendor
docker compose exec drupal phpdd ./web/modules/contrib/backerymails/ --file-extensions php,module,inc,install,test,profile,theme,info --exclude vendor
2 changes: 1 addition & 1 deletion tests/modules/backerymails_test/backerymails_test.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Backery Mails test
description: Support module for Backery Mails testing.
package: Testing
type: module
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^9.5 || ^10

dependencies:
- backerymails:backerymails

0 comments on commit c87ba20

Please sign in to comment.