Skip to content

Commit

Permalink
feature #104 Allow PHP 8 (sstok)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.1-dev branch.

Discussion
----------

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets | Closes #102 
| License       | MIT


(Recreated from #103) but on the main repository to trigger the workflow 😄 

Commits
-------

db8bb58 Allow PHP 8
  • Loading branch information
sstok authored Jan 9, 2021
2 parents 79a60a7 + db8bb58 commit 9153be8
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 62 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Full CI process
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
name: PHP ${{ matrix.PHP_VERSION }}
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
include:
- PHP_VERSION: '7.1'
SYMFONY_REQUIRE: '^3.4'
- PHP_VERSION: '7.2'
SYMFONY_REQUIRE: '^4.4'
- PHP_VERSION: '7.3'
SYMFONY_REQUIRE: '^5.0'
- PHP_VERSION: '7.4'
SYMFONY_REQUIRE: '^5.2'
- PHP_VERSION: '8.0'

steps:
# —— Setup Github actions 🐙 —————————————————————————————————————————————
# https://github.com/actions/checkout (official)
-
name: Checkout
uses: actions/checkout@v2

# https://github.com/shivammathur/setup-php (community)
-
name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.PHP_VERSION }}
extensions: mbstring, ctype, iconv, bcmath, filter, json
coverage: none
env:
update: true

# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
-
name: Install Composer dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.SYMFONY_REQUIRE }}
SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1
SYMFONY_PHPUNIT_REMOVE: "symfony/yaml"
SYMFONY_PHPUNIT_VERSION: '7.5.6'
run: |
git config --global author.name Sebastiaan Stok
git config --global author.email [email protected]
git config --global user.name Sebastiaan Stok
git config --global user.email [email protected]
rm -f composer.lock
composer global require symfony/flex
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi
## —— Tests ✅ ———————————————————————————————————————————————————————————
-
name: Run Tests
run: |
make test
lint:
name: PHP-QA
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
-
name: Checkout
uses: actions/checkout@v2

# https://github.com/shivammathur/setup-php (community)
-
name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, ctype, iconv, bcmath, filter, json
coverage: none

# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
-
name: Install Composer dependencies
run: |
rm -f composer.lock
composer global require symfony/flex
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi
-
name: Run PHP-QA
run: |
make cs-full
57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
QA_DOCKER_IMAGE=jakzal/phpqa:1.34.1-php7.4-alpine
QA_DOCKER_COMMAND=docker run --init -t --rm --user "$(shell id -u):$(shell id -g)" --volume /tmp/tmp-phpqa-$(shell id -u):/tmp --volume "$(shell pwd):/project" --workdir /project ${QA_DOCKER_IMAGE}

dist: install cs-full phpstan test-full
lint: install security-check cs-full phpstan

install:
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --prefer-dist --ansi

test:
./vendor/bin/simple-phpunit --verbose

# Linting tools
security-check: ensure
sh -c "${QA_DOCKER_COMMAND} security-checker security:check ./composer.lock"

phpstan: ensure
sh -c "${QA_DOCKER_COMMAND} phpstan analyse --configuration phpstan.neon"

cs: ensure
sh -c "${QA_DOCKER_COMMAND} php-cs-fixer fix -vvv --diff"

cs-full: ensure
sh -c "${QA_DOCKER_COMMAND} php-cs-fixer fix -vvv --using-cache=false --diff"

cs-full-check: ensure
sh -c "${QA_DOCKER_COMMAND} php-cs-fixer fix -vvv --using-cache=false --diff --dry-run"

ensure:
mkdir -p ${HOME}/.composer /tmp/tmp-phpqa-$(shell id -u)

.PHONY: install test phpstan cs cs-full cs-full-check
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@
"name": "Sebastiaan Stok",
"email": "[email protected]"
},
{
"name": "Luis Cordova",
"email": "[email protected]"
},
{
"name": "Community contributions",
"homepage": "https://github.com/rollerworks/PasswordStrengthBundle/contributors"
}
],
"require": {
"php": "^7.1",
"php": ">=7.1",
"rollerworks/password-strength-validator": "^1.0.1",
"symfony/framework-bundle": "^3.4.22 || ^4.0 || ^5.0"
},
Expand Down

0 comments on commit 9153be8

Please sign in to comment.