Skip to content

Commit

Permalink
Support mysql8 (#63)
Browse files Browse the repository at this point in the history
* Update PHP to 7.4

* Update to MySQL 8

* Implement new MySQL 8 definitions

* Update version requirements

Support earlier versions of PHP (this won't support MySQL 8 though)
Remove support for 7.1 (end of life)
Codesniffer fixes string access warnings
  • Loading branch information
brendankay authored Feb 26, 2020
1 parent 96b0295 commit 09bff69
Show file tree
Hide file tree
Showing 11 changed files with 524 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ cache:
- $HOME/.composer/cache/files

php:
- 7.1
- 7.2
- 7.3
- 7.4
- nightly

env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . /app

RUN composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader --prefer-dist

FROM graze/php-alpine:7.2 AS run
FROM graze/php-alpine:7.4 AS run

LABEL org.label-schema.schema-version="1.0" \
org.label-schema.vendor="graze" \
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL = /bin/sh

DOCKER = $(shell which docker)
PHP_VER := 7.2
PHP_VER := 7.4
IMAGE := graze/php-alpine:${PHP_VER}-test
VOLUME := /srv
DOCKER_RUN_BASE := ${DOCKER} run --rm -t -v $$(pwd):${VOLUME} -w ${VOLUME}
Expand Down Expand Up @@ -55,7 +55,10 @@ test-unit: ## Run the unit testsuite.
test-functional: example
docker-compose run --rm morphism diff morphism.conf
docker-compose run --rm morphism dump morphism.conf
docker-compose run --rm db mysqldump -hdb -umorphism -pmorphism morphism-test > dump.sql
# MySQL 8 generates a warning about password on command line being insecure, mysqldump doesn't have an option to
# specify the config in a file so just ignore the warning. Running through bash so stderr on the container can be
# redirected.
docker-compose run --rm db bash -c "mysqldump -hdb -umorphism -pmorphism morphism-test 2>/dev/null" >dump.sql
docker-compose run --rm morphism lint dump.sql
docker-compose run --rm morphism extract dump.sql
@rm -f dump.sql
Expand All @@ -73,6 +76,8 @@ test-matrix: ## Run the unit tests against multiple targets.
${MAKE} PHP_VER="7.0" build-update test
${MAKE} PHP_VER="7.1" build-update test
${MAKE} PHP_VER="7.2" build-update test
${MAKE} PHP_VER="7.3" build-update test
${MAKE} PHP_VER="7.4" build-update test

test-coverage: ## Run all tests and output coverage to the console.
${DOCKER_RUN} phpdbg7 -qrr vendor/bin/phpunit --coverage-text
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"license": "MIT",
"config": {
"platform": {
"php": "7.2"
"php": "7.4"
}
},
"authors": [
Expand All @@ -29,7 +29,7 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.2",

"doctrine/dbal": "^2.5",
"symfony/console": "^2.8 | ^3 | ^4",
Expand All @@ -39,7 +39,7 @@
"graze/standards": "^2.0",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^5.7.21 | ^6 | ^7",
"squizlabs/php_codesniffer": "^3.3.1",
"squizlabs/php_codesniffer": "^3.5.0",
"symfony/var-dumper": "^4.2"
},
"autoload": {
Expand Down
Loading

0 comments on commit 09bff69

Please sign in to comment.