Skip to content

Commit

Permalink
Merge pull request #47 from StadGent/8.x-1.x-dev
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
MPParsley authored Aug 22, 2022
2 parents b3a688a + 331c6dc commit 323ff3f
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 251 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@

# Ignore build artifacts
/build

# QA Drupal.
/*.local.*
/*.qa-drupal.*
/.phpunit.result.cache
75 changes: 37 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,60 @@
dist: bionic
language: php

php:
- 7.3
- 7.4

env:
global:
- MODULE_NAME=opening_hours
- COMPOSER_MEMORY_LIMIT=-1
matrix:
- DRUPAL=8.9
- DRUPAL=9.0
- DRUPAL=9.1
- 8.1

cache:
directories:
- $HOME/.composer/cache

jobs:
fast_finish: true

before_install:
# Update & configure composer.
# Update composer to latest v2.
- composer self-update --2
- composer --version
- composer config github-oauth.github.com ${GITHUB_TOKEN}
- composer config --global --auth http-basic.digipolis.repo.repman.io token ${REPMAN_TOKEN}

# Remember directories for later use.
- export DRUPAL_DIR="$TRAVIS_BUILD_DIR/../drupal"
- export MODULE_DIR="$DRUPAL_DIR/web/modules/$MODULE_NAME"
# Update SQLite.
- sudo echo "deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse" >> /etc/apt/sources.list
- sudo apt-get update
- sudo apt-get -y install sqlite3/focal

# Disable sending out e-mails.
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

# Configure the repository authentication mechanisms.
- if [ "${GITHUB_TOKEN}" != "" ]; then composer config github-oauth.github.com ${GITHUB_TOKEN}; fi
- if [ "${REPMAN_TOKEN}" != "" ]; then composer config --global --auth http-basic.digipolis.repo.repman.io token ${REPMAN_TOKEN}; fi

# Get the CodeClimate test reporter.
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build

install:
# Install Module.
- composer install --no-interaction --no-progress

# Install Drupal.
- composer create-project "drupal/recommended-project:$DRUPAL.x-dev" "$DRUPAL_DIR" --prefer-dist --no-interaction --no-progress

# Install Drupal Check.
- composer require mglaman/drupal-check:1.1.3 --working-dir="$DRUPAL_DIR" --no-interaction --no-progress

before_script:
# Link to module from within Drupal.
- ln -s . "$MODULE_DIR"
- touch .env.local
- composer install -n --no-progress

script:
# Run GrumPHP checks.
- vendor/bin/grumphp run

# Test for deprecations.
- cd "$DRUPAL_DIR"
- phpenv config-rm xdebug.ini
- ./vendor/bin/drupal-check -ad "$MODULE_DIR"
- vendor/bin/grumphp run -n

after_script:
- cd "$TRAVIS_BUILD_DIR"
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
# Send the coverage report to the CodeClimate test reporter.
- ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT

# Get and run the SonarQube scanner.
- SONAR_PROJECT_NAME="Drupal $(composer config name | cut -d / -f 2)"
- SONAR_PROJECT_KEY=web:$(echo "$TRAVIS_REPO_SLUG" | cut -d / -f 2)
- curl -L https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/4.3.0.2102/sonar-scanner-cli-4.3.0.2102.jar > sonar-scanner.jar
- "[ -d tests ] || mkdir tests"
- >
java -jar sonar-scanner.jar
-Dsonar.host.url=https://sonarqube.stad.gent
-Dsonar.login=$SONAR_LOGIN
-Dsonar.projectKey=$SONAR_PROJECT_KEY
-Dsonar.projectName="$SONAR_PROJECT_NAME"
-Dsonar.tests=tests
-Dsonar.exclusions=**/tests/**/*
-Dsonar.php.coverage.reportPaths=build/logs/clover.xml
46 changes: 29 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
{
"name": "drupal/opening_hours",
"type": "drupal-module",
"description": "Integrates the Opening Hours platform functionality.",
"license": "GPL-2.0-or-later",
"type": "drupal-module",
"keywords": [
"Drupal",
"gent",
"services",
"opening hours"
],
"license": "GPL-2.0+",
"homepage": "https://github.com/StadGent/drupal_module_opening-hours",
"minimum-stability": "dev",
"prefer-stable": true,
"authors": [
{
"name": "Peter Decuyper",
"email": "peter.decuyper@digipolis.gent"
"email": "peter.decuyper@district09.gent"
}
],
"homepage": "https://github.com/StadGent/drupal_module_opening-hours",
"support": {
"issues": "https://github.com/StadGent/drupal_module_opening-hours/issues",
"source": "https://github.com/StadGent/drupal_module_opening-hours"
},
"require": {
"php": "^7.3",
"stadgent/services-opening-hours": "^1.1"
"php": "^8.1",
"drupal/core": "^9.4",
"stadgent/services-opening-hours": "^1.3"
},
"require-dev": {
"digipolisgent/qa-drupal": "^1"
"digipolisgent/qa-drupal": "^1.5",
"drush/drush": "^11"
},
"scripts": {
"coverage": "vendor/bin/phpunit --configuration=phpunit-coverage.xml",
"grumphp": "vendor/bin/grumphp run --ansi",
"phpcs": "vendor/bin/phpcs -p --colors",
"phpstan": "vendor/bin/phpstan analyse --level=7 ./src",
"phpunit": "vendor/bin/phpunit",
"post-install-cmd": "vendor/bin/grumphp git:init"
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"phpro/grumphp-shim": true,
"ergebnis/composer-normalize": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"extra": {
"drush": {
"services": {
"drush.services.yml": "^9"
"drush.services.yml": "^11"
}
},
"grumphp": {
"config-default-path": "vendor/digipolisgent/qa-drupal/configs/grumphp-extension.yml"
}
},
"scripts": {
"post-install-cmd": "vendor/bin/grumphp git:init",
"coverage": "vendor/bin/phpunit --configuration=phpunit-coverage.xml",
"grumphp": "vendor/bin/grumphp run --ansi",
"phpcs": "vendor/bin/phpcs -p --colors",
"phpstan": "vendor/bin/phpstan analyse --level=7 ./src",
"phpunit": "vendor/bin/phpunit"
}
}
30 changes: 0 additions & 30 deletions grumphp.yml.dist

This file was deleted.

3 changes: 2 additions & 1 deletion opening_hours.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
use Drupal\Core\Entity\Sql\SqlContentEntityStorageException;

/**
* Implements hook_requirements().
Expand All @@ -27,7 +28,7 @@ function opening_hours_requirements($phase) {
// Provide a download link to the opening_hours jQuery plugin.
$requirements['opening_hours']['description'] = t('The <a href="@opening_hours" target="_blank">opening hours widget</a> plugin is missing. See <a href="@readme">README.md</a> for instructions on how to download and extract it.', [
'@opening_hours' => 'https://github.com/StadGent/npm_package_opening-hours-widget',
'@readme' => '/' . drupal_get_path('module', 'opening_hours') . '/README.md',
'@readme' => '/' . \Drupal::service('extension.list.module')->getPath('opening_hours') . '/README.md',
]);
$requirements['opening_hours']['severity'] = REQUIREMENT_ERROR;
}
Expand Down
1 change: 1 addition & 0 deletions opening_hours.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ opening_hours.service.autocomplete:
_controller: Drupal\opening_hours\Controller\ServiceController::autocomplete
_title: 'Lookup services'
requirements:
# The autocomplete route is accessible to the public.
_access: 'TRUE'
21 changes: 0 additions & 21 deletions phpcs-ruleset.xml.dist

This file was deleted.

13 changes: 0 additions & 13 deletions phpcs.xml

This file was deleted.

23 changes: 0 additions & 23 deletions phpmd.xml

This file was deleted.

51 changes: 0 additions & 51 deletions phpunit-coverage.xml

This file was deleted.

46 changes: 0 additions & 46 deletions phpunit.xml.dist

This file was deleted.

Loading

0 comments on commit 323ff3f

Please sign in to comment.