Skip to content

Commit

Permalink
Merge pull request #3104 from phpDocumentor/drop_old_php
Browse files Browse the repository at this point in the history
Bump to php 7.4 and php 8.1 support
  • Loading branch information
jaapio committed Dec 28, 2021
2 parents 384a593 + 60c26d0 commit 26f1be1
Show file tree
Hide file tree
Showing 17 changed files with 415 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Expand Up @@ -13,4 +13,4 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
snapshot: true
tags: 'latest, 3, 3.2'
tags: 'latest, 3, 3.3'
31 changes: 11 additions & 20 deletions .github/workflows/push.yml
Expand Up @@ -3,13 +3,13 @@ on:
branches:
- master
pull_request:
# Allow manually triggering the workflow.
# Allow manually triggering the workflow.
workflow_dispatch:
name: Qa workflow
env:
extensions: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib, fileinfo
key: cache-v1 # can be any string, change to clear the extension cache.
defaultPHPVersion: '7.2'
defaultPHPVersion: '7.4'
phiveGPGKeys: 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8A03EA3B385DBAA1,12CE0F1D262429A5
phiveHome: $GITHUB_WORKSPACE/.phive
jobs:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:

phpunit-with-coverage:
runs-on: ubuntu-latest
name: Unit tests [7.2 | ubuntu-latest]
name: Unit tests [7.4 | ubuntu-latest]
needs: setup
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -87,12 +87,11 @@ jobs:
- name: Install PHAR dependencies
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned phpunit
run: phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned

- name: PHPUnit
uses: docker://phpdoc/phpunit-ga:latest
with:
args: --testsuite=unit
run: php tools/phpunit --testsuite=unit

- name: Quick check code coverage level
run: php tests/coverage-checker.php 65

Expand Down Expand Up @@ -167,7 +166,7 @@ jobs:
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: 7.3
php-version: ${{ env.defaultPHPVersion }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

Expand All @@ -181,7 +180,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
php-version: ${{ env.defaultPHPVersion }}
extensions: ${{ env.extensions }}
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
tools: pecl, psalm
Expand Down Expand Up @@ -333,13 +332,12 @@ jobs:
- windows-latest
- macOS-latest
php-versions:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
exclude: # already covered in pre-test with coverage above
- operating-system: 'ubuntu-latest'
php-versions: '7.2'
php-versions: '7.4'
name: Unit tests [${{ matrix.php-versions }} | ${{ matrix.operating-system }}]

needs:
Expand Down Expand Up @@ -382,12 +380,6 @@ jobs:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned

- name: Install phpunit 8 for php 7.2
if: matrix.php-versions == '7.2'
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} phpunit:^8.5

- name: Run PHPUnit
run: php tools/phpunit --testsuite=unit,integration

Expand All @@ -397,10 +389,9 @@ jobs:
strategy:
matrix:
php-versions:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
operating-system:
- ubuntu-latest
- windows-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Expand Up @@ -5,7 +5,7 @@ name: Website
env:
extensions: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib, fileinfo, gnupg
key: cache-v1 # can be any string, change to clear the extension cache.
defaultPHPVersion: '7.2'
defaultPHPVersion: '7.4'
jobs:
docs:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,6 +1,6 @@
FROM composer:2 AS composer

FROM php:7.2
FROM php:8.0

# /usr/share/man/man1 needs to be created before installing openjdk-11-jre lest it will fail
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199#23
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Expand Up @@ -67,8 +67,7 @@ setup: install-phive
pull-containers:
docker pull phpdoc/phpcs-ga
docker pull phpdoc/phpstan-ga
docker pull phpdoc/phpunit-ga
docker pull php:7.2
docker pull php:7.4
docker pull node

.PHONY: phpcs
Expand All @@ -85,14 +84,14 @@ phpstan:

.PHONY: psalm
psalm:
docker run -it --rm -v${CURDIR}:/data -w /data php:7.3 ./tools/psalm
docker run -it --rm -v${CURDIR}:/data -w /data php:7.4 ./tools/psalm

.PHONY: lint
lint: phpcs

.PHONY: test
test: unit-test
docker run -it --rm -v${CURDIR}:/data -w /data php:7.2 -f ./tests/coverage-checker.php 65
docker run -it --rm -v${CURDIR}:/data -w /data php:7.4 -f ./tests/coverage-checker.php 65

.PHONY: unit-test
unit-test: SUITE=--testsuite=unit
Expand All @@ -104,7 +103,7 @@ integration-test: SUITE=--testsuite=integration --no-coverage
functional-test: SUITE=--testsuite=functional --no-coverage

unit-test integration-test functional-test:
docker run -it --rm -v${CURDIR}:/github/workspace phpdoc/phpunit-ga $(SUITE) $(ARGS)
docker run -it --rm -v${CURDIR}:/project -w=/project php:7.4 tools/phpunit $(SUITE) $(ARGS)

.PHONY: e2e-test
e2e-test: node_modules/.bin/cypress build/default/index.html build/clean/index.html
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -46,7 +46,7 @@ phpDocumentor supports the following:
Installation
------------

PhpDocumentor requires PHP 7.2 or higher to run.
PhpDocumentor requires PHP 7.4 or higher to run.
However, code of earlier PHP versions can be analyzed.

All templates provided with phpDocumentor have support for Class diagrams based on the read code base.
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -27,7 +27,7 @@
{ "type": "path", "url": "incubator/guides-markdown" }
],
"require": {
"php": ">=7.2.5||^8.0",
"php": "^7.4.0||^8.0",
"ext-ctype": "*",
"ext-hash": "*",
"ext-iconv": "*",
Expand All @@ -37,7 +37,7 @@
"ext-xml": "*",
"jawira/plantuml": "^1.27",
"jean85/pretty-package-versions": "^1.5 || ^2.0.1",
"league/commonmark": "^1.5",
"league/commonmark": "^2.1",
"league/flysystem": "^1.0",
"league/pipeline": "^1.0",
"league/tactician": "^1.0",
Expand Down Expand Up @@ -93,7 +93,7 @@
},
"sort-packages": true,
"platform": {
"php": "7.2.5"
"php": "7.4.0"
}
},
"replace": {
Expand All @@ -110,7 +110,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.4-dev"
},
"symfony": {
"id": "01C32VS9393M1CP9R8TEJMH62G",
Expand Down

0 comments on commit 26f1be1

Please sign in to comment.