Skip to content

Commit

Permalink
Merge pull request #13 from reactphp-parallel/dependabot/composer/wyr…
Browse files Browse the repository at this point in the history
…ihaximus/async-test-utilities-3.0.0

Bump wyrihaximus/async-test-utilities from 2.2.0 to 3.0.0
  • Loading branch information
WyriHaximus committed Nov 8, 2020
2 parents b7d62e9 + 6c6f06c commit 9a6aa9a
Show file tree
Hide file tree
Showing 9 changed files with 2,548 additions and 1,029 deletions.
50 changes: 42 additions & 8 deletions .github/workflows/ci.yml
Expand Up @@ -3,14 +3,33 @@ on:
push:
pull_request:
jobs:
generate-checks-strategy:
name: Generate Checks
runs-on: ubuntu-latest
outputs:
check: ${{ steps.generate-checks-strategy.outputs.check }}
steps:
- uses: actions/checkout@v1
- id: generate-checks-strategy
name: Generate check
run: |
printf "Checks found: %s\r\n" $(make task-list-ci)
printf "::set-output name=check::%s" $(make task-list-ci)
lint:
runs-on: ubuntu-latest
steps:
- name: Lint Code Base
uses: docker://github/super-linter:v2.2.0
composer-install:
strategy:
fail-fast: false
matrix:
php: [7.4]
composer: [lowest, current, highest]
needs: lint
runs-on: ubuntu-latest
container:
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
Expand All @@ -19,29 +38,44 @@ jobs:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: composer install --ansi --no-progress --no-interaction --prefer-dist
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'current'
- name: Install Dependencies
run: composer update --ansi --no-progress --no-interaction --prefer-dist
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'highest'
qa:
strategy:
fail-fast: false
matrix:
php: [7.4]
composer: [lowest, current, highest]
qa: [lint, cs, stan, psalm, unit-ci, infection, composer-require-checker, composer-unused]
needs: composer-install
check: ${{ fromJson(needs.generate-checks-strategy.outputs.check) }}
needs:
- composer-install
- generate-checks-strategy
runs-on: ubuntu-latest
container:
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- run: make ${{ matrix.qa }}
- name: Install Dependencies
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'current'
- name: Install Dependencies
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'highest'
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
if: matrix.check == 'backward-compatibility-check'
- run: make ${{ matrix.check }}
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
var
vendor
57 changes: 39 additions & 18 deletions Makefile
Expand Up @@ -3,43 +3,64 @@ SHELL=bash

.PHONY: *

DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l)

ifneq ("$(wildcard /.dockerenv)","")
DOCKER_RUN=
IN_DOCKER=TRUE
else ifneq ("$(DOCKER_CGROUP)","0")
IN_DOCKER=TRUE
else
IN_DOCKER=FALSe
endif

ifeq ("$(IN_DOCKER)","TRUE")
DOCKER_RUN=
else
DOCKER_RUN=docker run --rm -it \
-v `pwd`:`pwd` \
-w `pwd` \
"wyrihaximusnet/php:7.4-zts-alpine3.11-dev"
-v "`pwd`:`pwd`" \
-w "`pwd`" \
"wyrihaximusnet/php:7.4-zts-alpine3.12-dev"
endif

all: lint cs-fix cs stan psalm unit infection composer-require-checker composer-unused
all: syntax-php cs-fix cs stan psalm unit infection composer-require-checker composer-unused backward-compatibility-check

lint:
syntax-php: ## Lint PHP syntax
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .

cs:
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(nproc)
cs: ## Check the code for code style issues
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc)

cs-fix:
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(nproc)
cs-fix: ## Fix any automatically fixable code style issues
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc)

stan:
stan: ## Run static analysis (PHPStan)
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon

psalm:
$(DOCKER_RUN) vendor/bin/psalm --threads=$(nproc) --shepherd --stats
psalm: ## Run static analysis (Psalm)
$(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats

unit:
unit: ## Run tests
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml

unit-ci: unit
if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && sleep 3 && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi

infection:
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(nproc)
infection: ## Run mutation testing
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc)

composer-require-checker:
composer-require-checker: ## Ensure we require every package used in this package directly
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json

composer-unused:
composer-unused: ## Ensure we don't require any package we don't use in this package directly
$(DOCKER_RUN) composer unused --ansi

backward-compatibility-check: ## Check code for backwards incompatible changes
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true

task-list-ci:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'

help:
@printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
@printf " \033[32m%-32s\033[0m %s\n" "all" "Runs everything"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}'
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
"wyrihaximus/constants": "^1.4.3"
},
"require-dev": {
"wyrihaximus/async-test-utilities": "^2.2",
"wyrihaximus/async-test-utilities": "^3.0",
"wyrihaximus/ticking-promise": "^1.6"
},
"config": {
Expand Down

0 comments on commit 9a6aa9a

Please sign in to comment.