Skip to content

Commit

Permalink
Upgrade to php 8.2 as default version for tests and static-analysis (#50
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tigitz authored Sep 24, 2023
1 parent b984df8 commit 2ddefef
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ["7.4", "8.0", "8.1"]
php: ["7.4", "8.0", "8.1", "8.2"]
stability: [--prefer-lowest, --prefer-stable]
env:
PHP_VERSION: ${{ matrix.php }}
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Run tests
run: |
export WITH_COVERAGE=$(if [[ ("${{ matrix.php }}" = "8.1") && ("${{ matrix.stability }}" = "--prefer-stable") ]]; then echo "true"; else echo "false"; fi)
export WITH_COVERAGE=$(if [[ ("${{ matrix.php }}" = "8.2") && ("${{ matrix.stability }}" = "--prefer-stable") ]]; then echo "true"; else echo "false"; fi)
echo "WITH_COVERAGE=${WITH_COVERAGE}" >> $GITHUB_ENV
make vendor
make tests
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOCKER_COMPOSE ?= docker-compose
EXEC_PHP = $(DOCKER_COMPOSE) run --rm -T php
PHP_VERSION ?= 8.1
PHP_VERSION ?= 8.2
DEPS_STRATEGY ?= --prefer-stable
COMPOSER = $(EXEC_PHP) composer
WITH_COVERAGE ?= "FALSE"
Expand Down Expand Up @@ -40,7 +40,7 @@ examples-test:
echo "\n**************************************************************"; \
echo "Run example: $$file"; \
echo "**************************************************************\n"; \
$(EXEC_PHP) php $$file; \
sh -c "$(EXEC_PHP) php $$file" || exit 1 ;\
done

tu: ## Run unit tests
Expand Down Expand Up @@ -70,7 +70,7 @@ phpstan: vendor

phpstan-all-php-versions:
PHP_VERSION=7.4 make phpstan
PHP_VERSION=8.1 make phpstan
PHP_VERSION=8.2 make phpstan

phpstan-baseline: vendor
$(EXEC_PHP) vendor/bin/phpstan analyse src -c phpstan.$(PHP_VERSION).neon -a vendor/autoload.php --generate-baseline
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ $ make setup # start spellcheckers container
$ make tests-dox
```

You can also specify PHP version, dependency version target and if you want coverage. Coverage is only supported on PHP 8.0 for now.
You can also specify PHP version, dependency version target and if you want coverage.

```sh
$ PHP_VERSION=8.0 DEPS=LOWEST WITH_COVERAGE="true" make tests-dox
$ PHP_VERSION=8.2 DEPS=LOWEST WITH_COVERAGE="true" make tests-dox
```

Run `make help` to list all available tasks.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"psr/http-client": "^1.0",
"symfony/process": "^4.4.30 | ^5.0 |^6.0",
"thecodingmachine/safe": "^1.0 | ^2.0",
"webmozart/assert": "^1.3"
"webmozart/assert": "^1.11"
},
"require-dev": {
"aptoma/twig-markdown": "^3.0",
Expand Down
12 changes: 8 additions & 4 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV XDEBUG_MODE=coverage
RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \
&& echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"

ARG XDEBUG_VERSION=3.1.1
ARG PHP_VERSION

RUN apt-get update \
&& apt install -y \
Expand All @@ -25,9 +25,13 @@ RUN apt-get update \
aspell \
aspell-en \
aspell-ru \
libpspell-dev \
&& pecl install xdebug-${XDEBUG_VERSION} \
&& docker-php-ext-configure pspell \
libpspell-dev
RUN set -eux; \
case "$PHP_VERSION" in \
8.2*) pecl install xdebug-3.2.2;; \
*) pecl install xdebug-3.1.1;; \
esac
RUN docker-php-ext-configure pspell \
&& docker-php-ext-enable xdebug \
&& docker-php-ext-install pspell \
&& docker-php-ext-install zip \
Expand Down
File renamed without changes.

0 comments on commit 2ddefef

Please sign in to comment.