Skip to content

Commit

Permalink
maint/php84 (#3)
Browse files Browse the repository at this point in the history
* maint/php84 Updated `.gitattributes`.

* maint/php84 Updated `.github/workflows/test.yml`.

* maint/php84 Updated `.gitignore`.

* maint/php84 Updated `SECURITY.md`.

* maint/php84 Updated `composer.json`.

* maint/php84 Updated `docker-compose.yml`.

* maint/php84 Created `docker/php84/Dockerfile`.

* maint/php84 Created `docker/php84/php.ini`.

* maint/php84 Created `phpunit71.xml`.

* maint/php84 Created `phpunit72.xml`.

* maint/php84 Created `phpunit73.xml`.

* maint/php84 Created `phpunit74.xml`.

* maint/php84 Created `phpunit80.xml`.

* maint/php84 Created `phpunit81.xml`.

* maint/php84 Created `phpunit82.xml`.

* maint/php84 Created `phpunit83.xml`.

* maint/php84 Created `phpunit84.xml`.

* maint/php84 Updated `test.sh`.

---------

Co-authored-by: david_smith <david_smith@sweetwater.com>
  • Loading branch information
zero-to-prod and david_smith authored Jan 5, 2025
1 parent 3fa7e4e commit db6a898
Show file tree
Hide file tree
Showing 18 changed files with 247 additions and 32 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
/LICENSE.md export-ignore
/logo.png export-ignore
/phpunit.xml export-ignore
/phpunit71.xml export-ignore
/phpunit72.xml export-ignore
/phpunit73.xml export-ignore
/phpunit74.xml export-ignore
/phpunit80.xml export-ignore
/phpunit81.xml export-ignore
/phpunit82.xml export-ignore
/phpunit83.xml export-ignore
/phpunit84.xml export-ignore
/README.md export-ignore
/SECURITY.md export-ignore
/test.sh export-ignore
22 changes: 7 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,15 @@ jobs:

strategy:
matrix:
php-version: [php71, php72, php73, php74, php80, php81, php82, php83]
php-version: [84, 83, 82, 81, 80, 74, 73, 72, 71]

steps:
- uses: actions/checkout@v4

- name: Validate composer files
run: composer validate --strict
- name: Install dependencies for PHP${{ matrix.php-version }}
run: |
docker compose run --rm php${{ matrix.php-version }}composer composer update --no-cache
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-

- name: Install dependencies
run: docker compose run --rm -v ${{ github.workspace }}/test-output:/app/test-output ${{ matrix.php-version }}composer composer install --prefer-dist

- name: Run tests
run: docker compose run --rm -v ${{ github.workspace }}/test-output:/app/test-output ${{ matrix.php-version }} vendor/bin/phpunit
- name: Run PHPUnit tests for PHP${{ matrix.php-version }}
run: |
docker compose run --rm php${{ matrix.php-version }} vendor/bin/phpunit --configuration phpunit${{ matrix.php-version }}.xml
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ vendor
composer.lock
.phpunit.result.cache
.php-cs-fixer.cache
/.phpunit.cache/
/.phpunit.cache/
/vendor-php71/
/vendor-php72/
/vendor-php73/
/vendor-php74/
/vendor-php80/
/vendor-php81/
/vendor-php82/
/vendor-php83/
/vendor-php84/
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| 8.1.x | :white_check_mark: |
| 8.2.x | :white_check_mark: |
| 8.3.x | :white_check_mark: |
| 8.4.x | :white_check_mark: |

## Reporting a Vulnerability

Expand Down
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"psr4-classname"
],
"homepage": "https://github.com/zero-to-prod/psr4-classname",
"support": {
"email": "dave0016@gmail.com",
"issues": "https://github.com/zero-to-prod/psr4-classname/issues",
"source": "https://github.com/zero-to-prod/data-model",
"docs": "https://zero-to-prod.github.io/psr4-classname/",
"security": "https://github.com/zero-to-prod/psr4-classname/blob/main/SECURITY.md"
},
"license": "MIT",
"readme": "./README.md",
"authors": [
Expand Down
51 changes: 50 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
target: base
volumes:
- ./:/app
- ./vendor-php71:/app/vendor

php71debug:
build:
Expand All @@ -13,20 +14,23 @@ services:
volumes:
- ./:/app
- ./docker/php71:/usr/local/etc/php
- ./vendor-php71:/app/vendor

php71composer:
build:
context: docker/php71
target: composer
volumes:
- ./:/app
- ./vendor-php71:/app/vendor

php72:
build:
context: docker/php72
target: base
volumes:
- ./:/app
- ./vendor-php72:/app/vendor

php72debug:
build:
Expand All @@ -35,20 +39,23 @@ services:
volumes:
- ./:/app
- ./docker/php72:/usr/local/etc/php
- ./vendor-php72:/app/vendor

php72composer:
build:
context: docker/php72
target: composer
volumes:
- ./:/app
- ./vendor-php72:/app/vendor

php73:
build:
context: docker/php73
target: base
volumes:
- ./:/app
- ./vendor-php73:/app/vendor

php73debug:
build:
Expand All @@ -57,20 +64,23 @@ services:
volumes:
- ./:/app
- ./docker/php73:/usr/local/etc/php
- ./vendor-php73:/app/vendor

php73composer:
build:
context: docker/php73
target: composer
volumes:
- ./:/app
- ./vendor-php73:/app/vendor

php74:
build:
context: docker/php74
target: base
volumes:
- ./:/app
- ./vendor-php74:/app/vendor

php74debug:
build:
Expand All @@ -79,20 +89,23 @@ services:
volumes:
- ./:/app
- ./docker/php74:/usr/local/etc/php
- ./vendor-php74:/app/vendor

php74composer:
build:
context: docker/php74
target: composer
volumes:
- ./:/app
- ./vendor-php74:/app/vendor

php80:
build:
context: docker/php80
target: base
volumes:
- ./:/app
- ./vendor-php80:/app/vendor

php80debug:
build:
Expand All @@ -101,20 +114,23 @@ services:
volumes:
- ./:/app
- ./docker/php80:/usr/local/etc/php
- ./vendor-php80:/app/vendor

php80composer:
build:
context: docker/php80
target: composer
volumes:
- ./:/app
- ./vendor-php80:/app/vendor

php81:
build:
context: docker/php81
target: base
volumes:
- ./:/app
- ./vendor-php81:/app/vendor

php81debug:
build:
Expand All @@ -123,20 +139,23 @@ services:
volumes:
- ./:/app
- ./docker/php81:/usr/local/etc/php
- ./vendor-php81:/app/vendor

php81composer:
build:
context: docker/php81
target: composer
volumes:
- ./:/app
- ./vendor-php81:/app/vendor

php82:
build:
context: docker/php82
target: base
volumes:
- ./:/app
- ./vendor-php82:/app/vendor

php82debug:
build:
Expand All @@ -145,20 +164,23 @@ services:
volumes:
- ./:/app
- ./docker/php82:/usr/local/etc/php
- ./vendor-php82:/app/vendor

php82composer:
build:
context: docker/php82
target: composer
volumes:
- ./:/app
- ./vendor-php82:/app/vendor

php83:
build:
context: docker/php83
target: base
volumes:
- ./:/app
- ./vendor-php83:/app/vendor

php83debug:
build:
Expand All @@ -167,10 +189,37 @@ services:
volumes:
- ./:/app
- ./docker/php82:/usr/local/etc/php
- ./vendor-php83:/app/vendor

php83composer:
build:
context: docker/php83
target: composer
volumes:
- ./:/app
- ./:/app
- ./vendor-php83:/app/vendor

php84:
build:
context: docker/php84
target: base
volumes:
- ./:/app
- ./vendor-php84:/app/vendor

php84debug:
build:
context: docker/php84
target: debug
volumes:
- ./:/app
- ./docker/php82:/usr/local/etc/php
- ./vendor-php84:/app/vendor

php84composer:
build:
context: docker/php84
target: composer
volumes:
- ./:/app
- ./vendor-php84:/app/vendor
23 changes: 23 additions & 0 deletions docker/php84/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM php:8.4-cli AS base

WORKDIR /app

RUN apt-get update && apt-get install -y \
git \
unzip \
&& rm -rf /var/lib/apt/lists/*

FROM base AS composer

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

FROM base AS debug

RUN pecl channel-update pecl.php.net && \
pecl install xdebug && \
docker-php-ext-enable xdebug && \
echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

WORKDIR /app

CMD ["bash"]
2 changes: 2 additions & 0 deletions docker/php84/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zend_extension=xdebug.so
xdebug.mode=coverage
21 changes: 21 additions & 0 deletions phpunit71.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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"
bootstrap="vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true"
colors="true"
>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
21 changes: 21 additions & 0 deletions phpunit72.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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"
bootstrap="vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true"
colors="true"
>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
13 changes: 13 additions & 0 deletions phpunit73.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" verbose="true" colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
Loading

0 comments on commit db6a898

Please sign in to comment.