diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..93605c0d1c4485a0d11fa749822b2c586d9b1a3a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,43 @@ +stages: + - test + - deploy + +.test: &test + stage: test + tags: [docker] + image: php:${CI_JOB_NAME}-cli-alpine + variables: + COMPOSER_ALLOW_SUPERUSER: "1" + before_script: + - curl -sSL https://github.com/composer/composer/releases/download/1.8.4/composer.phar --output /usr/local/bin/composer + - chmod +x /usr/local/bin/composer + - apk update && apk add unzip git + - php -v + - composer -V + - composer global require hirak/prestissimo + script: + - composer install + - php -l src/*.php + - vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no + cache: + key: composer-cache + paths: + - /root/.composer/cache + +"7.0": + <<: *test + +"7.1": + <<: *test + +"7.2": + <<: *test + +"7.3": + <<: *test + +deploy: + stage: deploy + tags: [docker] + image: appropriate/curl + script: ./.packagist.sh diff --git a/.packagist.sh b/.packagist.sh new file mode 100755 index 0000000000000000000000000000000000000000..a4d7718b4bf54dd689cfcbdc75a0c3e97d2033c7 --- /dev/null +++ b/.packagist.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +curl -fsSL \ + -H"Content-Type: application/json" \ + -d'{"repository":{"url":"'$CI_PROJECT_URL'.git"}}' \ + "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" diff --git a/composer.json b/composer.json index 3719c910aad2c5c8244d6ebd36b2825aa73bb022..728440a8b5ffd06fed4491e2b3b4aefac95144a7 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^5.6 | ^7.0", + "php": "^7.0", "ext-json": "*", "friendsofphp/php-cs-fixer": "^2.13" }, @@ -19,5 +19,8 @@ }, "config": { "sort-packages": true + }, + "archive": { + "exclude": [".?*"] } }