Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG PHP_VERSION=8.2
ARG PHPUNIT_VERSION=10.4.0
ARG PHPSTAN_VERSION=1.10.38

FROM php:${PHP_VERSION}-cli-alpine
COPY --from=composer /usr/bin/composer /usr/bin/composer

ARG PHPUNIT_VERSION
ARG PHPSTAN_VERSION

RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath
RUN wget -O phpunit https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar && chmod +x phpunit
RUN wget -O phpstan https://github.com/phpstan/phpstan/releases/download/${PHPSTAN_VERSION}/phpstan.phar && chmod +x phpstan

3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PHP_VERSION=8.2
PHPUNIT_VERSION=10.4.0
PHPSTAN_VERSION=1.10.38
17 changes: 13 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@
*.png binary

# Remove files for archives generated using `git archive`
phpunit.xml.dist export-ignore
.travis.yml export-ignore
.gitignore export-ignore
.gitattributes export-ignore
.editorconfig export-ignore
.env export-ignore
.gitattributes export-ignore
.gitignore export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
compose.yaml export-ignore
Makefile export-ignore

# Remove directories for archives
.docker/ export-ignore
.github/ export-ignore
tests/ export-ignore
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2']
php-version: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v3
Expand All @@ -26,11 +26,13 @@ jobs:
coverage: pcov

- name: Composer install
continue-on-error: ${{ matrix.php-version == '8.3' }}
run: |
composer --version
composer install

- name: Run PHPUnit
continue-on-error: ${{ matrix.php-version == '8.3' }}
run: |
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
vendor/bin/phpunit --coverage-clover=coverage.xml
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
install:
@docker compose run --rm -it php composer install

phpunit:
@docker compose run --rm -it php composer test

coverage:
@docker compose run --rm -it php composer test-coverage

phpstan:
@docker compose run --rm -it php composer stan

cs-check:
@docker compose run --rm -it php composer cs-check

cs-fix:
@docker compose run --rm -it php composer cs-fix

test: install cs-check phpstan phpunit
14 changes: 14 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
php:
build:
context: .
dockerfile: .docker/Dockerfile
args:
PHP_VERSION: "${PHP_VERSION:-8.2}"
PHPUNIT_VERSION: "${PHPUNIT_VERSION:-10.4.0}"
PHPSTAN_VERSION: "${PHPSTAN_VERSION:-1.10.38}"
volumes:
- ./:/code
working_dir: /code
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"scripts": {
"test": "phpunit",
"test-coverage": "phpunit --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --coverage-clover tmp/coverage/coverage.xml",
"stan": "vendor/bin/phpstan.phar analyse",
"stan": "phpstan analyse",
"lowest": "validate-prefer-lowest",
"lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json",
"cs-check": "vendor/bin/phpcs",
Expand Down