diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b8a66b7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: 'BUG ' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..8fd1720 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: 'FEATURE ' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..19f7e63 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,13 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + ci: + name: CI + uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 + with: + phpcoverage: true diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 051ef9a..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,15 +0,0 @@ -inherit: true - -build: - nodes: - analysis: - tests: - override: [php-scrutinizer-run] - -checks: - php: - code_rating: true - duplication: true - -filter: - paths: [src/*, tests/*] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f09701a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: php - -services: - - mysql - - postgresql - -env: - global: - - TRAVIS_NODE_VERSION="10" - -matrix: - include: - - php: 7.0 - env: DB=MYSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_TEST=1 - - php: 7.1 - env: DB=MYSQL RECIPE_VERSION=4.3.x-dev PHPUNIT_TEST=1 - - php: 7.2 - env: DB=PGSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1 PHPCS_TEST=1 - - php: 7.3 - env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_COVERAGE_TEST=1 - -before_script: - - phpenv rehash - - phpenv config-rm xdebug.ini - - - composer validate - - composer require --no-update silverstripe/recipe-cms:"$RECIPE_VERSION" - - if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:^2.1; fi - - composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile - -script: - - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi - - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi - - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi - -after_success: - - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml -F php; fi diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index e2847b5..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,83 +0,0 @@ -pipeline { - agent any - stages { - - stage('Build') { - steps { - sh 'mkdir silverstripe-cache' - sh 'composer require --prefer-dist --no-update silverstripe-themes/simple:~3.2' - sh 'composer update --no-suggest --prefer-dist' - } - } - - stage('PHPUnit') { - steps { - sh 'vendor/bin/phpunit --log-junit=build/logs/junit.xml --coverage-xml=build/logs/coverage' - } - } - - stage('Checkstyle Report') { - steps { - sh 'vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=phpcs.xml.dist --extensions=php,inc --ignore=autoload.php --ignore=vendor/ src/ tests/ || exit 0' - } - } - - stage('Mess Detection Report') { - steps { - sh 'vendor/bin/phpmd src xml codesize,unusedcode,naming --reportfile build/logs/pmd.xml --exclude vendor/ --exclude autoload.php || exit 0' - } - } - - stage('CPD Report') { - steps { - sh 'vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml --exclude vendor src/ tests/ || exit 0' - } - } - - stage('Lines of Code') { - steps { - sh 'vendor/bin/phploc --count-tests --exclude vendor/ --log-csv build/logs/phploc.csv --log-xml build/logs/phploc.xml src/ tests/' - } - } - - stage('Software metrics') { - steps { - sh 'mkdir build/pdepend' - sh 'vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg --ignore=vendor src' - } - } - - stage('Generate documentation') { - steps { - sh 'vendor/bin/phpdox -f phpdox.xml' - } - } - - stage('Publish Documentation') { - steps { - publishHTML (target: [ - allowMissing: false, - alwaysLinkToLastBuild: false, - keepAll: true, - reportDir: 'docs/html', - reportFiles: 'index.html', - reportName: "API" - ]) - } - } - - stage('Cleanup') { - steps { - sh 'rm -rf silverstripe-cache' - } - } - } - - post { - always { - junit 'build/logs/*.xml' - recordIssues enabledForFailure: true, tool: checkStyle(pattern: '**/logs/checkstyle.xml') - recordIssues enabledForFailure: true, tool: cpd(pattern: '**/logs/pmd-cpd.xml') - } - } -} \ No newline at end of file diff --git a/composer.json b/composer.json index 973932d..ed155b1 100644 --- a/composer.json +++ b/composer.json @@ -15,17 +15,12 @@ "require": { "silverstripe/recipe-cms": "^4.0", "dynamic/silverstripe-collection": "^2.0", - "symbiote/silverstripe-gridfieldextensions": "^3.0", + "symbiote/silverstripe-gridfieldextensions": "^3.4", "bummzack/sortablefile": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^5.7", - "squizlabs/php_codesniffer": "^3.0", - "phpmd/phpmd": "^2.6", - "sebastian/phpcpd": "^3.0", - "phploc/phploc": "^4.0", - "pdepend/pdepend": "^2.5", - "theseer/phpdox": "^0.11.0" + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "^3.0" }, "autoload": { "psr-4": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 62d50dd..86b1ca4 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -2,10 +2,13 @@ CodeSniffer ruleset for SilverStripe coding conventions. - - + src + tests + + + - - + + diff --git a/phpdox.xml b/phpdox.xml deleted file mode 100644 index cc263d6..0000000 --- a/phpdox.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -