diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml new file mode 100644 index 00000000..b8f3718b --- /dev/null +++ b/.github/workflows/pr-checks.yaml @@ -0,0 +1,21 @@ +name: PR Checks + +on: + pull_request: + branches: + - master + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Docker + run: docker build . --tag omnipay-vindicia + + - name: Test + run: docker run --rm omnipay-vindicia make test diff --git a/.gitignore b/.gitignore index f592830e..d294db76 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,5 @@ *~ *# -composer.lock -composer-psalm.lock -composer.phar /vendor .idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5b1d85a4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM php:7.4-cli + +RUN apt-get update && \ + apt-get install -y \ + libxml2-dev \ + unzip \ + git \ + zlib1g-dev \ + libzip-dev && \ + docker-php-ext-install soap zip + +COPY . /omnipay-vindicia +WORKDIR /omnipay-vindicia + +COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer + +RUN composer install diff --git a/Makefile b/Makefile index 511cb81d..4f4337dc 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,3 @@ -# Test - -all: with_psalm - -no_psalm: style test - -with_psalm: style psalm test - style: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpcs --standard=PSR2 --error-severity=1 --warning-severity=6 tests @@ -14,23 +6,3 @@ test: psalm: vendor/bin/psalm - -# Install - -install: install_with_psalm - -install_with_psalm: - COMPOSER=composer-psalm.json php composer.phar install - -install_no_psalm: - php composer.phar install - -# Update - -update: update_with_psalm - -update_with_psalm: - COMPOSER=composer-psalm.json php composer.phar update - -update_no_psalm: - php composer.phar update diff --git a/composer-psalm.json b/composer-psalm.json deleted file mode 100644 index b25143af..00000000 --- a/composer-psalm.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "vimeo/omnipay-vindicia", - "type": "library", - "description": "Vindicia driver for the Omnipay payment processing library", - "keywords": [ - "gateway", - "merchant", - "omnipay", - "pay", - "payment", - "vindicia" - ], - "homepage": "https://github.com/vimeo/omnipay-vindicia", - "license": "MIT", - "authors": [ - { - "name": "Nicky Robinson", - "email": "nickr@vimeo.com" - } - ], - "autoload": { - "psr-4": { - "Omnipay\\Vindicia\\" : "src/" - } - }, - "require": { - "omnipay/common": "~2.0", - "vimeo/payment-gateway-logger": "^1.0", - "composer/ca-bundle": "^1.1", - "ext-soap": "*" - }, - "require-dev": { - "omnipay/tests": "~2.0", - "vimeo/psalm": "0.3.*" - } -} diff --git a/composer.json b/composer.json index ae7c0739..1cfc992f 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,7 @@ "ext-soap": "*" }, "require-dev": { - "omnipay/tests": "~2.0" + "omnipay/tests": "~4.0", + "squizlabs/php_codesniffer": "~3.7.2" } }