diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..11bcef8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +*.Dockerfile +vendor/ +composer.lock diff --git a/composer.json b/composer.json index 1c3563a..38e2679 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,19 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "phpcompatibility/php-compatibility": "^9.3" }, + "scripts": { + "cs-check": "phpcs", + "tests": "XDEBUG_MODE=coverage ./vendor/bin/phpunit tests --coverage-text --whitelist Mf2", + "test-mf1": "./vendor/bin/phpunit --group microformats/tests/mf1", + "check-and-test": [ + "@cs-check", + "@tests" + ], + "check-and-test-all": [ + "@check-and-test", + "@test-mf1" + ] + }, "autoload": { "files": ["Mf2/Parser.php"] }, diff --git a/php56.Dockerfile b/php56.Dockerfile new file mode 100644 index 0000000..47547d6 --- /dev/null +++ b/php56.Dockerfile @@ -0,0 +1,17 @@ +FROM php:5.6-cli + +COPY --from=composer:2.2.12 /usr/bin/composer /usr/bin/composer + +RUN apt-get update && apt-get install -y \ + zip \ + && rm -rf /var/cache/apt/ + +RUN pecl install xdebug-2.5.5 \ + && docker-php-ext-enable xdebug + +WORKDIR /usr/share/php-mf2 +COPY . . + +RUN composer install --prefer-dist --no-cache --no-interaction + +CMD ["composer", "--no-interaction", "run", "check-and-test-all"]