Skip to content

Commit

Permalink
Test against PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Sep 20, 2024
1 parent 1feee90 commit 0068ca2
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:

jobs:
phpcs:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ on:
jobs:
phpstan:
name: phpstan
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
ini-values: memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.composer/cache
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ on:
jobs:
phpunit:
name: phpunit
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -24,7 +25,7 @@ jobs:
ini-values: memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.composer/cache
Expand Down
2 changes: 1 addition & 1 deletion MIGRATION.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Migration
# Changelog

## v2.x to v6.0

Expand Down
52 changes: 31 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
ARG PHP_VERSION
FROM php:${PHP_VERSION}-cli-buster
FROM php:${PHP_VERSION}-cli-bookworm

RUN apt-get update && \
apt-get install -y autoconf pkg-config && \
pecl channel-update pecl.php.net && \
pecl install xdebug && \
RUN <<-EOF
apt-get update
apt-get install -y autoconf pkg-config
pecl channel-update pecl.php.net
pecl install xdebug
docker-php-ext-enable opcache xdebug
EOF

RUN echo '\
xdebug.client_host=host.docker.internal\n\
xdebug.mode=develop\n\
xdebug.start_with_request=yes\n\
' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN <<-EOF
cat <<-SHELL >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
xdebug.client_host=host.docker.internal
xdebug.mode=develop
xdebug.start_with_request=yes
SHELL

RUN echo '\
display_errors=On\n\
error_reporting=E_ALL\n\
date.timezone=UTC\n\
' >> /usr/local/etc/php/conf.d/php.ini
cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
display_errors=On
error_reporting=E_ALL
date.timezone=UTC
SHELL
EOF

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN apt-get update && \
apt-get install unzip && \
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
mv composer.phar /usr/local/bin/composer && \
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc
RUN <<-EOF
apt-get update
apt-get install unzip
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
mv composer.phar /usr/local/bin/composer
cat <<-SHELL >> /root/.bashrc
export PATH="$HOME/.composer/vendor/bin:$PATH"
SHELL
EOF

RUN composer global require -n squizlabs/php_codesniffer
RUN composer global require squizlabs/php_codesniffer

ENV COMPOSER_ROOT_VERSION 6.0.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The icanboogie/common package is free software.
It is released under the terms of the following BSD License.

Copyright (c) 2007-2023 by Olivier Laviale
Copyright (c) 2007-present by Olivier Laviale
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ test-container-82:
@-docker-compose run --rm app82 bash
@docker-compose down -v

.PHONY: test-container-83
test-container-83:
@-docker-compose run --rm app83 bash
@docker-compose down -v

.PHONY: lint
lint:
@XDEBUG_MODE=off phpcs -s
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ The project is continuously tested by [GitHub actions](https://github.com/ICanBo
## Code of Conduct

This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in
this project and its community, you are expected to uphold this code.
this project and its community, you're expected to uphold this code.



## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
See [CONTRIBUTING](CONTRIBUTING.md) for details.



Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"ext-mbstring": "*"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.0"
"phpstan/phpstan": "^1.12",
"phpunit/phpunit": "^10.0|^11.0"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 11 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
version: "3.2"
services:
app81:
build:
Expand All @@ -23,3 +22,14 @@ services:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
app83:
build:
context: .
args:
PHP_VERSION: "8.3"
environment:
PHP_IDE_CONFIG: 'serverName=icanboogie-common'
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
4 changes: 3 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
beStrictAboutCoverageMetadata="true"
Expand All @@ -7,6 +7,8 @@
cacheDirectory=".phpunit.cache"
colors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
executionOrder="depends,defects"
>
<coverage/>
Expand Down

0 comments on commit 0068ca2

Please sign in to comment.