From bc0aa3710c5ed264d7be9d3cc5d5c7e44f94b4fb Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Sat, 2 Dec 2023 00:40:47 +0100 Subject: [PATCH] Clean up folder structure --- .../CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 .github/FUNDING.yml | 14 +++ .github/SECURITY.md | 7 ++ renovate.json => .github/renovate.json | 0 .github/workflows/ci.yaml | 95 +++++++++++++++++++ README.md | 2 +- composer.json | 5 +- 8 files changed, 120 insertions(+), 3 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) create mode 100644 .github/FUNDING.yml create mode 100644 .github/SECURITY.md rename renovate.json => .github/renovate.json (100%) create mode 100644 .github/workflows/ci.yaml diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..a531da07 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,14 @@ +# These are supported funding model platforms + +github: curry684 + +# patreon: # Replace with a single Patreon username +# open_collective: # Replace with a single Open Collective username +# ko_fi: # Replace with a single Ko-fi username +# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +# liberapay: # Replace with a single Liberapay username +# issuehunt: # Replace with a single IssueHunt username +# otechie: # Replace with a single Otechie username +# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000..b435489d --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting Security Issues + +To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/omines/datatables-bundle/security/advisories/new) tab. + +The team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. + +Report security bugs in third-party modules to the person or team maintaining the module. diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..eb3ed3ed --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,95 @@ +name: test suite + +on: + pull_request_target: + push: + branches: + - master + schedule: # Ensure weekly test also if no pushes happen to keep up with dependencies + - cron: 0 11 * * 1 + +jobs: + run: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental || matrix.dependencies == 'beta' }} + strategy: + fail-fast: false + matrix: + php: + - '8.1' + - '8.2' + - '8.3' + dependencies: [ stable, beta, lowest ] + experimental: [ false ] + include: + - description: 'stable dependencies' + dependencies: stable + - description: 'lowest dependencies' + dependencies: lowest + - description: 'beta/RC dependencies' + dependencies: beta + # - description: 'nightly with stable dependencies' + # php: 8.4 + # experimental: true + + name: PHP ${{ matrix.php }} ${{ matrix.description }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: intl, mbstring + ini-values: zend.assertions=1 + + - name: Dump PHP diagnostics + run: php -i && php -m + + - name: Allow beta dependencies + run: composer config minimum-stability beta + if: matrix.dependencies == 'beta' + + - name: Install dependencies + run: composer update --no-progress ${{ (matrix.dependencies == 'lowest') && '--prefer-lowest --prefer-stable' || ''}} + + - name: Check for dangerous and broken dependencies + run: composer audit + if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} + + - name: Check code style + run: vendor/bin/php-cs-fixer fix --dry-run + if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} + + - name: Run PHPStan static analysis + run: vendor/bin/phpstan + if: ${{ matrix.dependencies != 'lowest' && !matrix.experimental }} + + - name: Run automated tests + run: vendor/bin/phpunit --coverage-text --coverage-xml build/coverage-xml --coverage-cobertura build/cobertura.xml + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: build/cobertura.xml + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: '90 98' + + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: code-coverage-results.md + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + diff --git a/README.md b/README.md index d6e09f1d..cac628d4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ simply don't have a lot of time to spare, so your questions will be answered fas ## Contributing -Please see [CONTRIBUTING.md](https://github.com/omines/datatables-bundle/blob/master/CONTRIBUTING.md) for details. +Please see [CONTRIBUTING.md](https://github.com/omines/datatables-bundle/blob/master/.github/CONTRIBUTING.md) for details. ## Legal diff --git a/composer.json b/composer.json index 783400c3..0f0df30f 100644 --- a/composer.json +++ b/composer.json @@ -37,15 +37,16 @@ "doctrine/doctrine-bundle": "^2.7|^3.0", "doctrine/orm": "^2.13.1", "doctrine/persistence": "^2.0|^3.0.3", - "friendsofphp/php-cs-fixer": "^3.9.5", + "friendsofphp/php-cs-fixer": "^v3.40.0", "mongodb/mongodb": "^1.12", - "ocramius/package-versions": "^2.5", + "ocramius/package-versions": "^2.8", "phpoffice/phpspreadsheet": "^1.24.1", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8.2", "phpstan/phpstan-doctrine": "^1.3.12", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-symfony": "^1.2.9", + "phpunit/phpunit": "^10.5", "ruflin/elastica": "^6.0|^7.2", "symfony/browser-kit": "^6.1.3|^7.0", "symfony/css-selector": "^6.1.3|^7.0",