Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Switch to Circle 2.0 (#5)
Browse files Browse the repository at this point in the history
* Try out circle 2.0

* fix path to phpunit

* Run on 5.6 and 7.2 also

* Lower required phpunit version to test against php 5.6

* Try to run integration tests

* Need to run integrations

* Install composer packages

* Fetch the zipkin server ip address

* Fix integration test

* Need to setup remote docker
  • Loading branch information
chingor13 authored Apr 19, 2018
1 parent 963fd9f commit c5e1e8e
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 254 deletions.
67 changes: 67 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
unit-config: &unit-config
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: composer install -n --prefer-dist

- save_cache:
paths:
- ./vendor
key: v1-dependencies-{{ checksum "composer.json" }}

# run tests!
- run: vendor/bin/phpcs --standard=./phpcs-ruleset.xml
- run: vendor/bin/phpunit

version: 2
jobs:
php56:
<<: *unit-config
docker:
- image: circleci/php:5.6-node

php70:
<<: *unit-config
docker:
- image: circleci/php:7.0-node

php71:
<<: *unit-config
docker:
- image: circleci/php:7.1-node

php72:
<<: *unit-config
docker:
- image: circleci/php:7.2-node

integration:
docker:
- image: circleci/php:7.2-node
steps:
- checkout

- setup_remote_docker:
docker_layer_caching: true

- run: docker network create -d bridge nw_zipkin
- run: docker run -d -p9411:9411 --name=zipkin-server --network=nw_zipkin openzipkin/zipkin:2.7
- run: docker build -t integration-test .
- run: docker run --network=nw_zipkin -e ZIPKIN_HOST=zipkin-server integration-test vendor/bin/phpunit --config=./phpunit-integration.xml.dist

workflows:
version: 2
units:
jobs:
- php56
- php70
- php71
- php72
- integration
34 changes: 6 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE
FROM $BASE_IMAGE
FROM circleci/php:7.2-node

RUN mkdir -p /build && \
apt-get update -y && \
apt-get install -y -q --no-install-recommends \
build-essential \
g++ \
gcc \
libc-dev \
make \
autoconf \
git \
unzip
COPY . /workspace
WORKDIR /workspace

COPY . /build/
RUN sudo chown -R $(whoami) /workspace

WORKDIR /build/
RUN composer install -n --prefer-dist

RUN EXPECTED_SIGNATURE=$(curl -f https://composer.github.io/installer.sig) && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
ACTUAL_SIGNATURE=$(php -r "echo (hash_file('SHA384', 'composer-setup.php'));") && \
test $EXPECTED_SIGNATURE = $ACTUAL_SIGNATURE && \
php composer-setup.php && \
php -r "unlink('composer-setup.php');"

RUN php composer.phar install && \
vendor/bin/phpcs --standard=./phpcs-ruleset.xml && \
vendor/bin/phpunit

RUN pecl install opencensus-alpha && \
php -dextension=opencensus.so vendor/bin/phpunit
ENTRYPOINT []
20 changes: 0 additions & 20 deletions Dockerfile.integration

This file was deleted.

19 changes: 0 additions & 19 deletions circle.yml

This file was deleted.

30 changes: 0 additions & 30 deletions cloudbuild.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"opencensus/opencensus": "~0.4"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpunit/phpunit": "^5.0",
"squizlabs/php_codesniffer": "2.*",
"guzzlehttp/guzzle": "~6.0"
},
Expand Down
29 changes: 0 additions & 29 deletions integration-tests.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions scripts/dump_credentials.php

This file was deleted.

76 changes: 0 additions & 76 deletions scripts/install_test_dependencies.sh

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/run_test_suite.sh

This file was deleted.

0 comments on commit c5e1e8e

Please # to comment.