Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support php 8.4 #441

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/architectural-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: PHPArkitect
uses: docker://phparkitect/arkitect-github-actions:latest
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:

jobs:
build:
runs-on: "ubuntu-22.04"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: [ '8.2', '8.3', '8.4']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'd like to keep compatibility from php 8.0

coverage-driver: [ 'pcov' ]

steps:
Expand All @@ -23,7 +23,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2.2
tools: composer:v2.8
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}

Expand All @@ -32,7 +32,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -52,22 +52,22 @@ jobs:
run: ./bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml

- name: Upload coverage to Codecov
if: ${{ matrix.php-versions == '7.1' }}
if: ${{ matrix.php-versions == '8.4' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

phar:
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would that mean when ubuntu gets upgraded we automatically get the latest version? If that the case an approach where we explicitly set the version is preferred imo

needs: build
steps:
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.1
tools: composer:v2.2
php-version: 8.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use the smaller supported version (8.0)?

tools: composer:v2.8
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}

Expand All @@ -84,19 +84,18 @@ jobs:
run: mv ./phparkitect.phar phparkitect-${{ github.sha }}.phar

- name: "Upload phar file artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: phar-artifact
path: ./phparkitect-${{ github.sha }}.phar
retention-days: 1

smoke-test-phar:
needs: phar
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
coverage-driver: [ 'pcov' ]
php-versions: [ '8.2', '8.3', '8.4' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above


steps:
- name: Install PHP
Expand All @@ -107,7 +106,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}

- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
# will download phar in project root
name: phar-artifact
Expand All @@ -117,11 +116,11 @@ jobs:

publish_phar:
needs: [build, smoke-test-phar]
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
# will download phar in project root
name: phar-artifact
Expand All @@ -136,7 +135,7 @@ jobs:

publish_docker_images:
needs: [build, smoke-test-phar]
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest

if: github.ref == 'refs/heads/main' || github.event_name == 'release'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/vendor/
.phpunit.result.cache
.phpunit.cache
.idea
.php_cs.cache
.php-cs-fixer.cache
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@PHP84Migration' => true,
'@Symfony:risky' => true,
'@PHP71Migration:risky' => true,
'@PSR2' => true,
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG PHP_VERSION=7.1
ARG PHP_VERSION=8.4

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the version 8.4 and not the minor that we can support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for local testing with the last version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be the smaller supported version maybe? Like 8.0 🤔


FROM php:${PHP_VERSION}-cli-alpine AS php_build

COPY --from=composer:2.0 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer

WORKDIR /arkitect

Expand Down
Binary file modified bin/box.phar
Binary file not shown.
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,24 @@
}
],
"require": {
"php": "^7.1|^8",
"symfony/finder": "^3.0|^4.0|^5.0|^6.0|^7.0",
"symfony/event-dispatcher": "^3.0|^4.0|^5.0|^6.0|^7.0",
"symfony/console": "^3.0|^4.0|^5.0|^6.0|^7.0",
"symfony/polyfill-php80": "^1.20",
"nikic/php-parser": "~4",
"webmozart/assert": "^1.9",
"php": "^8",
"symfony/finder": "^6.0|^7.0",
"symfony/event-dispatcher": "^6.0|^7.0",
"symfony/console": "^6.0|^7.0",
"nikic/php-parser": "^5.4",
"webmozart/assert": "^1.11",
"ext-json": "*",
"phpstan/phpdoc-parser": "^1.2",
"ondram/ci-detector": "^4.1"
"phpstan/phpdoc-parser": "^2.0",
"ondram/ci-detector": "^4.2"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"symfony/var-dumper": "^3.0|^4.0|^5.0|^6.0|^7.0",
"vimeo/psalm": "^4.6",
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^7.5|^9.0|^10.0",
"symfony/var-dumper": "^6.0|^7.0",
"vimeo/psalm": "^6.0",
"friendsofphp/php-cs-fixer": "^3.68",
"phpunit/phpunit": "^11.5",
"mikey179/vfsstream": "^1.6",
"phpspec/prophecy": "^1.10"
"phpspec/prophecy": "^1.20"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 7 additions & 11 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">

cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
Loading