Skip to content

Commit a27fe6e

Browse files
authored
Merge pull request #37 from WyriHaximus/bump-php-to-7.4-plus-QA
Bump to PHP 7.4 and update to next gen QA
2 parents 8bb0ce7 + a8c2183 commit a27fe6e

21 files changed

+4941
-3190
lines changed

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
pull_request:
5+
jobs:
6+
generate-checks-strategy:
7+
name: Generate Checks
8+
runs-on: ubuntu-latest
9+
outputs:
10+
check: ${{ steps.generate-checks-strategy.outputs.check }}
11+
steps:
12+
- uses: actions/checkout@v1
13+
- id: generate-checks-strategy
14+
name: Generate check
15+
run: |
16+
printf "Checks found: %s\r\n" $(make task-list-ci)
17+
printf "::set-output name=check::%s" $(make task-list-ci)
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Lint Code Base
22+
uses: docker://github/super-linter:v2.2.0
23+
composer-install:
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
php: [7.4]
28+
composer: [lowest, current, highest]
29+
needs: lint
30+
runs-on: ubuntu-latest
31+
container:
32+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root
33+
steps:
34+
- uses: actions/checkout@v1
35+
- name: Cache composer packages
36+
uses: actions/cache@v1
37+
with:
38+
path: ./vendor/
39+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
40+
- name: Install Dependencies
41+
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
42+
if: matrix.composer == 'lowest'
43+
- name: Install Dependencies
44+
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o
45+
if: matrix.composer == 'current'
46+
- name: Install Dependencies
47+
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o
48+
if: matrix.composer == 'highest'
49+
qa:
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
php: [7.4]
54+
composer: [lowest, current, highest]
55+
check: ${{ fromJson(needs.generate-checks-strategy.outputs.check) }}
56+
needs:
57+
- composer-install
58+
- generate-checks-strategy
59+
runs-on: ubuntu-latest
60+
container:
61+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root
62+
steps:
63+
- uses: actions/checkout@v1
64+
- name: Cache composer packages
65+
uses: actions/cache@v1
66+
with:
67+
path: ./vendor/
68+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
69+
- name: Install Dependencies
70+
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
71+
if: matrix.composer == 'lowest'
72+
- name: Install Dependencies
73+
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o
74+
if: matrix.composer == 'current'
75+
- name: Install Dependencies
76+
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o
77+
if: matrix.composer == 'highest'
78+
- name: Fetch Tags
79+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
80+
if: matrix.check == 'backward-compatibility-check'
81+
- run: make ${{ matrix.check }}
82+
env:
83+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
84+
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}

.php_cs

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

.scrutinizer.yml

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

.travis.yml

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Cees-Jan Kiewiet
3+
Copyright (c) 2020 Cees-Jan Kiewiet
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,69 @@
1-
all:
2-
composer run-script qa-all --timeout=0
1+
# set all to phony
2+
SHELL=bash
33

4-
all-extended:
5-
composer run-script qa-all-extended --timeout=0
4+
.PHONY: *
65

7-
ci:
8-
composer run-script qa-ci --timeout=0
6+
DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l)
7+
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer/cache)
98

10-
ci-extended:
11-
composer run-script qa-ci-extended --timeout=0
9+
ifneq ("$(wildcard /.dockerenv)","")
10+
IN_DOCKER=TRUE
11+
else ifneq ("$(DOCKER_CGROUP)","0")
12+
IN_DOCKER=TRUE
13+
else
14+
IN_DOCKER=FALSe
15+
endif
1216

13-
ci-windows:
14-
composer run-script qa-ci-windows --timeout=0
17+
ifeq ("$(IN_DOCKER)","TRUE")
18+
DOCKER_RUN=
19+
else
20+
DOCKER_RUN=docker run --rm -it \
21+
-v "`pwd`:`pwd`" \
22+
-v "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" \
23+
-w "`pwd`" \
24+
"wyrihaximusnet/php:7.4-nts-alpine3.12-dev"
25+
endif
1526

16-
contrib:
17-
composer run-script qa-contrib --timeout=0
27+
all: ## Runs everything ###
28+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
1829

19-
init:
20-
composer ensure-installed
30+
syntax-php: ## Lint PHP syntax
31+
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
2132

22-
cs:
23-
composer cs
33+
cs-fix: ## Fix any automatically fixable code style issues
34+
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) -vvvv
2435

25-
cs-fix:
26-
composer cs-fix
36+
cs: ## Check the code for code style issues
37+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc)
2738

28-
infection:
29-
composer infection
39+
stan: ## Run static analysis (PHPStan)
40+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon
3041

31-
unit:
32-
composer run-script unit --timeout=0
42+
psalm: ## Run static analysis (Psalm)
43+
$(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats
3344

34-
stan:
35-
composer run-script stan --timeout=0
45+
unit-testing: ## Run tests
46+
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml
47+
$(DOCKER_RUN) test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./build/logs/clover.xml && vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./build/logs/coveralls-upload.json || true
3648

37-
unit-coverage:
38-
composer run-script unit-coverage --timeout=0
49+
mutation-testing: ## Run mutation testing
50+
$(DOCKER_RUN) vendor/bin/roave-infection-static-analysis-plugin --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc)
3951

40-
ci-coverage: init
41-
composer ci-coverage
52+
composer-require-checker: ## Ensure we require every package used in this package directly
53+
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json
54+
55+
composer-unused: ## Ensure we don't require any package we don't use in this package directly
56+
$(DOCKER_RUN) composer unused --ansi
57+
58+
backward-compatibility-check: ## Check code for backwards incompatible changes
59+
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true
60+
61+
shell: ## Provides Shell access in the expected environment ###
62+
$(DOCKER_RUN) ash
63+
64+
task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ###
65+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
66+
67+
help: ## Show this help ###
68+
@printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
69+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#'

0 commit comments

Comments
 (0)