Skip to content

Commit 736c99f

Browse files
committed
Test against PHP 8.4
1 parent 0288676 commit 736c99f

16 files changed

+128
-47
lines changed

.github/workflows/code-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-20.04
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
- name: Install PHP
1515
uses: shivammathur/setup-php@v2
1616
with:

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
runs-on: ubuntu-20.04
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
- name: Install PHP
1515
uses: shivammathur/setup-php@v2
1616
with:
1717
php-version: "7.1"
1818
ini-values: memory_limit=-1
1919
tools: composer:v2
2020
- name: Cache dependencies
21-
uses: actions/cache@v2
21+
uses: actions/cache@v4
2222
with:
2323
path: |
2424
~/.composer/cache

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515
- "7.2"
1616
- "7.3"
1717
- "7.4"
18+
- "8.4"
1819
steps:
1920
- name: Checkout
20-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2122
- name: Install PHP
2223
uses: shivammathur/setup-php@v2
2324
with:
@@ -26,7 +27,7 @@ jobs:
2627
ini-values: memory_limit=-1
2728
tools: composer:v2
2829
- name: Cache dependencies
29-
uses: actions/cache@v2
30+
uses: actions/cache@v4
3031
with:
3132
path: |
3233
~/.composer/cache
@@ -39,6 +40,8 @@ jobs:
3940

4041
- name: Run PHPUnit
4142
run: make test-coveralls
43+
env:
44+
PHPUNIT_VERSION: "${{ matrix.php-version == '8.4' && '11' || '07' }}"
4245

4346
- name: Upload code coverage
4447
if: ${{ matrix.php-version == '7.1' }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.phpunit.result.cache
12
build
23
composer.lock
34
vendor

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CHANGELOG
2+
3+
## 1.x to 2.0
4+
5+
### New requirements
6+
7+
- PHP 7.1+
8+
9+
### New features
10+
11+
None
12+
13+
### Backward Incompatible Changes
14+
15+
None
16+
17+
### Deprecated Features
18+
19+
None
20+
21+
### Other Changes
22+
23+
None

Dockerfile

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
FROM php:7.1-cli-buster
1+
ARG PHP_TAG=7.1-cli-buster
2+
FROM php:${PHP_TAG}
23

3-
RUN docker-php-ext-enable opcache && \
4-
docker-php-source delete
4+
RUN <<-EOF
5+
docker-php-ext-enable opcache
6+
EOF
57

6-
RUN echo '\
7-
display_errors=On\n\
8-
error_reporting=E_ALL\n\
9-
date.timezone=UTC\n\
10-
' >> /usr/local/etc/php/conf.d/php.ini
8+
RUN <<-EOF
9+
cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
10+
display_errors=On
11+
error_reporting=E_ALL
12+
date.timezone=UTC
13+
SHELL
14+
EOF
1115

1216
ENV COMPOSER_ALLOW_SUPERUSER 1
1317

14-
RUN apt-get update && \
15-
apt-get install unzip && \
16-
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
17-
mv composer.phar /usr/local/bin/composer && \
18-
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc
18+
RUN <<-EOF
19+
apt-get update
20+
apt-get install unzip
21+
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
22+
mv composer.phar /usr/local/bin/composer
23+
cat <<-SHELL >> /root/.bashrc
24+
export PATH="$HOME/.composer/vendor/bin:$PATH"
25+
SHELL
26+
EOF
1927

2028
RUN composer global require squizlabs/php_codesniffer

Makefile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# customization
22

3-
PACKAGE_NAME = icanboogie/inflector
4-
PHPUNIT = vendor/bin/phpunit
3+
PHPUNIT = vendor/bin/phpunit --configuration=phpunit$(PHPUNIT_VERSION).xml
54

65
# do not edit the following lines
76

@@ -13,24 +12,32 @@ test-dependencies: vendor
1312

1413
.PHONY: test
1514
test: test-dependencies
16-
@$(PHPUNIT)
15+
@XDEBUG_MODE=none $(PHPUNIT)
1716

1817
.PHONY: test-coverage
1918
test-coverage: test-dependencies
2019
@mkdir -p build/coverage
21-
@$(PHPUNIT) --coverage-html build/coverage
20+
@XDEBUG_MODE=coverage $(PHPUNIT) --coverage-html build/coverage
2221

2322
.PHONY: test-coveralls
2423
test-coveralls: test-dependencies
2524
@mkdir -p build/logs
26-
@$(PHPUNIT) --coverage-clover build/logs/clover.xml
25+
@XDEBUG_MODE=coverage $(PHPUNIT) --coverage-clover build/logs/clover.xml
2726

2827
.PHONY: test-container
29-
test-container:
30-
@docker-compose run --rm app bash
28+
test-container: test-container-71
29+
30+
.PHONY: test-container-71
31+
test-container-71:
32+
@-docker-compose run --rm app71 bash
33+
@docker-compose down -v
34+
35+
.PHONY: test-container-84
36+
test-container-84:
37+
@-docker-compose run --rm app84 bash
3138
@docker-compose down -v
3239

3340
.PHONY: lint
3441
lint:
35-
@phpcs
36-
@vendor/bin/phpstan
42+
@XDEBUG_MODE=off phpcs -s
43+
@XDEBUG_MODE=off vendor/bin/phpstan

UPGRADING.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"ext-mbstring": "*"
2626
},
2727
"require-dev": {
28-
"icanboogie/common": "^2.0",
29-
"phpstan/phpstan": "^0.12.92",
30-
"phpunit/phpunit": "^7.5"
28+
"icanboogie/common": "^2.1",
29+
"phpstan/phpstan": "^0.12.100|^2.0",
30+
"phpunit/phpunit": "^7.5.20|^11.4"
3131
},
3232
"conflict": {
3333
"icanboogie/common": "<2.0"

docker-compose.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
---
2-
version: "3.2"
32
services:
4-
app:
5-
build: .
3+
app71:
4+
build:
5+
context: .
6+
args:
7+
PHP_TAG: "7.1-cli-buster"
68
environment:
79
PHP_IDE_CONFIG: 'serverName=icanboogie-inflector'
8-
volumes:
10+
PHPUNIT_VERSION: "07"
11+
volumes: &vol
912
- .:/app:delegated
1013
- ~/.composer:/root/.composer:delegated
1114
working_dir: /app
15+
app84:
16+
build:
17+
context: .
18+
args:
19+
PHP_TAG: "8.4.0RC4-cli-bookworm"
20+
environment:
21+
PHP_IDE_CONFIG: 'serverName=icanboogie-inflector'
22+
PHPUNIT_VERSION: "11"
23+
volumes: *vol
24+
working_dir: /app

0 commit comments

Comments
 (0)