Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migrate to common prism setup #960

Merged
merged 2 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ composer.phar
.editorconfig
test.php
.idea/
test/prism_linux_amd64
test/prism/*
!test/prim
*.code-workspace
.vscode
prism*
prism
temp.php
example*.php
TODO.txt
Expand Down
26 changes: 9 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
language: php

before_script:
- if [ -n "$GIT_HUB_TOKEN" ]; then composer config -g github-oauth.github.com "$GIT_HUB_TOKEN"; fi;
- composer install
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-stable -n; fi;
- "./test/prism.sh &"
- sleep 60
services:
- docker

script:
- "vendor/bin/phpunit test --filter test*"
- make test-docker

after_success:
- bash <(curl -s https://codecov.io/bash)

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

env:
- dependencies=lowest
- dependencies=highest
- version=5.6
- version=7.0
- version=7.1
- version=7.2
- version=7.3
- version=7.4

notifications:
slack:
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG version=latest
FROM php:$version

RUN apt-get update \
&& apt-get install -y zip

RUN curl -s https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer

COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt
RUN update-ca-certificates

WORKDIR /app
COPY . .

RUN make install
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
.PHONY: clean install ci-install test bundle
.PHONY: clean install ci-install test test-integ test-docker bundle

clean:
@rm -rf vendor composer.lock sendgrid-php.zip

install: clean
ifdef GIT_HUB_TOKEN
composer config -g github-oauth.github.com $(GIT_HUB_TOKEN)
endif

composer install

ifeq ($(dependencies), lowest)
composer update --prefer-lowest --prefer-stable -n
endif

ci-install: clean
composer install --no-dev

test: install
test:
vendor/bin/phpunit test/unit --filter test*

test-integ: test
vendor/bin/phpunit test --filter test*

version ?= latest
test-docker:
eshanholtz marked this conversation as resolved.
Show resolved Hide resolved
curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/prism/prism.sh | dependencies=lowest version=$(version) bash
curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/prism/prism.sh | dependencies=highest version=$(version) bash

bundle: ci-install
zip -r sendgrid-php.zip . -x \*.git\* \*composer.json\* \*scripts\* \*test\* \*.travis.yml\* \*prism\*
5 changes: 2 additions & 3 deletions test/BaseTestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ class BaseTestClass extends TestCase
*/
public static function setUpBeforeClass()
{
self::$apiKey = "SENDGRID_API_KEY";
$host = ['host' => 'http://localhost:4010'];
self::$sg = new SendGrid(self::$apiKey, $host);
self::$apiKey = 'SENDGRID_API_KEY';
self::$sg = new SendGrid(self::$apiKey);
}

/**
Expand Down
63 changes: 0 additions & 63 deletions test/prism.sh

This file was deleted.