Skip to content

Commit

Permalink
Remove phpcodesniffer-composer-installer and manually add codesniffer (
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosen authored Jun 24, 2020
1 parent 1a0cb62 commit cb39579
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: '0 6 * * *'

env:
DRUPAL_TESTING_TEST_CODING_STYLES: false
DRUPAL_TESTING_TEST_CODING_STYLES: true
DRUPAL_TESTING_PROJECT_BASEDIR: ${{ github.workspace }}/tests/module
DRUPAL_TESTING_DATABASE_USER: root
DRUPAL_TESTING_DATABASE_PASSWORD: root
Expand Down Expand Up @@ -61,7 +61,9 @@ jobs:
echo "::add-path::$GITHUB_WORKSPACE/bin"
- name: Run tests
run: test-drupal-project
run: |
composer install
test-drupal-project --verbose
env:
DRUPAL_TESTING_COMPOSER_PROJECT: ${{ matrix.DRUPAL_TESTING_COMPOSER_PROJECT }}
DRUPAL_TESTING_DRUPAL_VERSION: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION }}
Expand Down Expand Up @@ -104,7 +106,9 @@ jobs:
echo "::add-path::$GITHUB_WORKSPACE/bin"
- name: Install project
run: test-drupal-project install
run: |
composer install
test-drupal-project install --verbose
- name: Zip build
run: cd /tmp; tar cfz build.tgz test; mv build.tgz ${GITHUB_WORKSPACE}
Expand Down Expand Up @@ -148,4 +152,4 @@ jobs:
run: tar xCfz /tmp build/build.tgz test; rm -rf build

- name: Run the tests
run: test-drupal-project run_tests
run: test-drupal-project run_tests --verbose
14 changes: 2 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,16 @@ branches:
- master

env:
matrix:
- DRUPAL_TESTING_PROJECT_BASEDIR=${TRAVIS_BUILD_DIR}/vendor/drupal/paragraphs_features
- DRUPAL_TESTING_PROJECT_BASEDIR=${TRAVIS_BUILD_DIR}/vendor/drupal/scheduler_content_moderation_integration DRUPAL_TESTING_TEST_JAVASCRIPT=false
global:
- DRUPAL_TESTING_PROJECT_BASEDIR=${TRAVIS_BUILD_DIR}/tests/module
- PATH="$TRAVIS_BUILD_DIR/bin:$TRAVIS_BUILD_DIR/vendor/bin:$PATH"
- DRUPAL_TESTING_PHPCS_IGNORE_PATTERN="*.md"

before_install:
- composer config repositories.drupal composer https://packages.drupal.org/8
- composer config repositories.assets composer https://asset-packagist.org
- composer config repositories.paragraph_features git https://github.com/thunder/paragraphs_features.git
- composer config repositories.scheduler_content_moderation_integration git https://github.com/thunder/scheduler_content_moderation_integration.git
- composer require drupal/paragraphs_features:dev-8.x-1.x --no-update
- composer require drupal/scheduler_content_moderation_integration:dev-8.x-1.x --no-update

install:
- composer install

script:
- test-drupal-project
- test-drupal-project --verbose

notifications:
email: false
3 changes: 2 additions & 1 deletion bin/test-drupal-project
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Options:
-h, --help Display this help.
-nc, --no-cleanup Do not cleanup after successful tests. Set this option to keep the installation.
-co, --clean-only Just run cleanup and exit.
-v, --verbose Verbose output
Example:
test-drupal-module Run everything.
Expand Down Expand Up @@ -62,7 +63,7 @@ for i in "${@}"; do
-nc | --no-cleanup)
DRUPAL_TESTING_CLEANUP=false
;;
-v)
-v | --verbose)
export DRUPAL_TESTING_VERBOSE=true
set -o xtrace
;;
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
],
"require": {
"php": ">=7.2",
"drupal/coder": "^8.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"drupal/coder": "^8.3",
"symfony/yaml": "^3.4"
}
}
1 change: 1 addition & 0 deletions lib/stages/coding_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ _stage_coding_style() {
__test_php_coding_styles() {
printf "Checking php coding styles\n\n"

phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer
phpcs -ps --standard=Drupal --extensions=php,module,inc,install,test,profile,theme --ignore="${DRUPAL_TESTING_PHPCS_IGNORE_PATTERN}" .
phpcs -ps --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme --ignore="${DRUPAL_TESTING_PHPCS_IGNORE_PATTERN}" .
}
Expand Down

0 comments on commit cb39579

Please sign in to comment.