diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 5ef1389..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,16 +0,0 @@ -## Affected Version - -Show version numbers by pasting the output of `composer info --direct`. -Alternatively, get the framework version information from the CMS. -In SilverStripe 4.3 and newer you may find the Help menu in the bottom left corner, unfold it and hover over the version number to get the information. -Otherwise, simply hover over the SilverStripe logo in the bottom left corner of the CMS. - -## Description - -Describe expected and observed behaviour. -For visual issues, please include browser version and screenshots. -Please read [our contributing docs](../CONTRIBUTING.md). - -## Steps to Reproduce - -Help us with step-by-step instructions. 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/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d245014..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,5 +0,0 @@ -Thanks for contributing, you're awesome! :star: -Please describe expected and observed behaviour, and what you're fixing. -For visual fixes, please include tested browsers and screenshots. -Search for related existing issues and link to them if possible. -Please read [our contributing docs](../CONTRIBUTING.md). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e5c3181 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,103 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +on: + push: + branches: [ '**' ] + pull_request: + branches: [ '**' ] + +name: "CI" + +jobs: + tests: + name: "Tests" + + runs-on: "ubuntu-latest" + + env: + php_extensions: ctype, dom, fileinfo, hash, intl, mbstring, session, simplexml, tokenizer, xml, pdo, mysqli, gd, zip + + services: + mysql: + image: "mysql:5.7" + env: + MYSQL_ALLOW_EMPTY_PASSWORD: true + MYSQL_ROOT_PASSWORD: + MYSQL_DATABASE: test_db + ports: + - 3306/tcp + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: false + matrix: + php-version: + - "7.3" + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.php_extensions }}" + coverage: "xdebug" + + - name: "Start mysql service" + run: "sudo /etc/init.d/mysql start" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}" + restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" + + - name: "Authorize private packagist" + env: + COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }} + run: "if [[ $COMPOSER_TOKEN ]]; then composer config --global --auth http-basic.repo.packagist.com token $COMPOSER_TOKEN; fi" + + - name: "Install dependencies with composer" + run: "composer install --no-ansi --no-interaction --no-progress" + + - name: "Run tests with phpunit/phpunit" + env: + SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }} + run: "vendor/bin/phpunit --coverage-html=build/logs/coverage/html --coverage-xml=build/logs/coverage" + + - name: "Archive code coverage results" + uses: "actions/upload-artifact@v2" + with: + name: "coverage" + path: "build/logs/coverage/html" + + - name: "Run tests with squizlabs/php_codesniffer" + run: "vendor/bin/phpcs src/ tests/ --standard=phpcs.xml.dist --report=checkstyle --report-file=build/logs/checkstyle.xml" + + - name: "Archive checkstyle results" + uses: "actions/upload-artifact@v2" + with: + name: "checkstyle" + path: "build/logs/checkstyle.xml" + + #- name: "Run tests with phpmd/phpmd" + # run: "vendor/bin/phpmd src xml codesize,unusedcode,naming --reportfile build/logs/pmd.xml --exclude vendor/ --exclude autoload.php" + + - name: "Run tests with phploc/phploc" + run: "vendor/bin/phploc --count-tests --exclude vendor/ --log-csv build/logs/phploc.csv --log-xml build/logs/phploc.xml src/ tests/ +" + - name: "Run tests with pdepend/pdepend" + run: "vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --ignore=vendor src" + + - name: "Publish documentation" + run: "vendor/bin/phpdox -f phpdox.xml" + + - name: "Archive documentation" + uses: "actions/upload-artifact@v2" + with: + name: "documentation" + path: "docs/html" diff --git a/.travis.yml b/.travis.yml index cebd18f..c3c4e67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,15 +10,11 @@ env: matrix: include: - - php: 5.6 - env: DB=MYSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_TEST=1 - - php: 7.0 - env: DB=PGSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_TEST=1 - - php: 7.1 - env: DB=MYSQL RECIPE_VERSION=4.3.x-dev PHPUNIT_TEST=1 PHPCS_TEST=1 - php: 7.2 - env: DB=PGSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1 + env: DB=MYSQL RECIPE_VERSION=4.5.x-dev PHPUNIT_TEST=1 PHPCS_TEST=1 - php: 7.3 + env: DB=PGSQL RECIPE_VERSION=4.6.x-dev PHPUNIT_TEST=1 + - php: 7.4 env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_COVERAGE_TEST=1 before_script: 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