Skip to content

Commit

Permalink
Merge pull request #756 from ergebnis/feature/php80
Browse files Browse the repository at this point in the history
Enhancement: Add support for PHP 8.0
  • Loading branch information
localheinz committed Feb 17, 2024
2 parents dc61919 + 87a73ef commit b085041
Show file tree
Hide file tree
Showing 15 changed files with 611 additions and 1,766 deletions.
18 changes: 10 additions & 8 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ branches:
required_approving_review_count: 1
required_status_checks:
checks:
- context: "Backward-Compatibility Analysis (8.1, locked)"
- context: "Code Coverage (8.1, locked)"
- context: "Coding Standards (8.1, locked)"
- context: "Dependency Analysis (8.1, locked)"
- context: "Mutation Tests (8.1, locked)"
- context: "Refactoring (8.1, locked)"
- context: "Security Analysis (8.1, locked)"
- context: "Static Code Analysis (8.1, locked)"
- context: "Code Coverage (8.0, locked)"
- context: "Coding Standards (8.0, locked)"
- context: "Dependency Analysis (8.0, locked)"
- context: "Mutation Tests (8.0, locked)"
- context: "Refactoring (8.0, locked)"
- context: "Security Analysis (8.0, locked)"
- context: "Static Code Analysis (8.0, locked)"
- context: "Tests (8.0, highest)"
- context: "Tests (8.0, locked)"
- context: "Tests (8.0, lowest)"
- context: "Tests (8.1, highest)"
- context: "Tests (8.1, locked)"
- context: "Tests (8.1, lowest)"
Expand Down
67 changes: 8 additions & 59 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,6 @@ on: # yamllint disable-line rule:truthy
- "main"

jobs:
backward-compatibility-analysis:
name: "Backward-Compatibility Analysis"

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
- "8.1"

dependencies:
- "locked"

steps:
- name: "Checkout"
uses: "actions/checkout@v4.1.1"
with:
fetch-depth: 0

- name: "Set up PHP"
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.9.0"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v4.0.0"
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "ergebnis/.github/actions/composer/install@1.9.0"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run backward-compatibility analysis with roave/backward-compatibility-check"
run: "vendor/bin/roave-backward-compatibility-check --ansi --format=github-actions"

code-coverage:
name: "Code Coverage"

Expand All @@ -71,7 +19,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -132,7 +80,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -201,7 +149,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -257,7 +205,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -309,7 +257,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -368,7 +316,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -418,7 +366,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -469,6 +417,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-require-checker" version="^4.7.1" installed="4.7.1" location="./.phive/composer-require-checker" copy="false"/>
<phar name="composer-require-checker" version="~4.4.0" installed="4.4.0" location="./.phive/composer-require-checker" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

$license->save();

$ruleSet = PhpCsFixer\Config\RuleSet\Php81::create()->withHeader($license->header());
$ruleSet = PhpCsFixer\Config\RuleSet\Php80::create()->withHeader($license->header());

$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`2.7.0...main`][2.7.0...main].

### Changed

- Added support for PHP 8.0 ([#756]), by [@localheinz]

## [`2.7.0`][2.7.0]

For a full diff see [`2.6.0...2.7.0`][2.6.0...2.7.0].
Expand Down Expand Up @@ -163,6 +167,7 @@ For a full diff see [`36912f6...1.0.0`][36912f6...1.0.0].
[#532]: https://github.com/ergebnis/clock/pull/532
[#604]: https://github.com/ergebnis/clock/pull/604
[#680]: https://github.com/ergebnis/clock/pull/680
[#756]: https://github.com/ergebnis/clock/pull/756

[@ergebnis]: https://github.com/ergebnis
[@localheinz]: https://github.com/localheinz
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@
"source": "https://github.com/ergebnis/clock"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"psr/clock": "^1.0.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.42.0",
"ergebnis/license": "^2.4.0",
"ergebnis/php-cs-fixer-config": "^6.22.0",
"ergebnis/phpunit-slow-test-detector": "^2.10.0",
"infection/infection": "~0.27.9",
"phpunit/phpunit": "^10.5.10",
"infection/infection": "~0.26.19",
"phpunit/phpunit": "^9.6.16",
"psalm/plugin-phpunit": "~0.18.4",
"rector/rector": "^1.0.1",
"roave/backward-compatibility-check": "^8.6.0",
"vimeo/psalm": "^5.22.1"
},
"provide": {
Expand All @@ -58,7 +57,7 @@
"abandoned": "report"
},
"platform": {
"php": "8.1.26"
"php": "8.0.30"
},
"preferred-install": "dist",
"sort-packages": true
Expand Down
Loading

0 comments on commit b085041

Please sign in to comment.