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

Commit c5e1e8e

Browse files
authored
Switch to Circle 2.0 (#5)
* 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
1 parent 963fd9f commit c5e1e8e

File tree

10 files changed

+74
-254
lines changed

10 files changed

+74
-254
lines changed

.circleci/config.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
unit-config: &unit-config
2+
steps:
3+
- checkout
4+
5+
# Download and cache dependencies
6+
- restore_cache:
7+
keys:
8+
- v1-dependencies-{{ checksum "composer.json" }}
9+
# fallback to using the latest cache if no exact match is found
10+
- v1-dependencies-
11+
12+
- run: composer install -n --prefer-dist
13+
14+
- save_cache:
15+
paths:
16+
- ./vendor
17+
key: v1-dependencies-{{ checksum "composer.json" }}
18+
19+
# run tests!
20+
- run: vendor/bin/phpcs --standard=./phpcs-ruleset.xml
21+
- run: vendor/bin/phpunit
22+
23+
version: 2
24+
jobs:
25+
php56:
26+
<<: *unit-config
27+
docker:
28+
- image: circleci/php:5.6-node
29+
30+
php70:
31+
<<: *unit-config
32+
docker:
33+
- image: circleci/php:7.0-node
34+
35+
php71:
36+
<<: *unit-config
37+
docker:
38+
- image: circleci/php:7.1-node
39+
40+
php72:
41+
<<: *unit-config
42+
docker:
43+
- image: circleci/php:7.2-node
44+
45+
integration:
46+
docker:
47+
- image: circleci/php:7.2-node
48+
steps:
49+
- checkout
50+
51+
- setup_remote_docker:
52+
docker_layer_caching: true
53+
54+
- run: docker network create -d bridge nw_zipkin
55+
- run: docker run -d -p9411:9411 --name=zipkin-server --network=nw_zipkin openzipkin/zipkin:2.7
56+
- run: docker build -t integration-test .
57+
- run: docker run --network=nw_zipkin -e ZIPKIN_HOST=zipkin-server integration-test vendor/bin/phpunit --config=./phpunit-integration.xml.dist
58+
59+
workflows:
60+
version: 2
61+
units:
62+
jobs:
63+
- php56
64+
- php70
65+
- php71
66+
- php72
67+
- integration

Dockerfile

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG BASE_IMAGE
16-
FROM $BASE_IMAGE
15+
FROM circleci/php:7.2-node
1716

18-
RUN mkdir -p /build && \
19-
apt-get update -y && \
20-
apt-get install -y -q --no-install-recommends \
21-
build-essential \
22-
g++ \
23-
gcc \
24-
libc-dev \
25-
make \
26-
autoconf \
27-
git \
28-
unzip
17+
COPY . /workspace
18+
WORKDIR /workspace
2919

30-
COPY . /build/
20+
RUN sudo chown -R $(whoami) /workspace
3121

32-
WORKDIR /build/
22+
RUN composer install -n --prefer-dist
3323

34-
RUN EXPECTED_SIGNATURE=$(curl -f https://composer.github.io/installer.sig) && \
35-
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
36-
ACTUAL_SIGNATURE=$(php -r "echo (hash_file('SHA384', 'composer-setup.php'));") && \
37-
test $EXPECTED_SIGNATURE = $ACTUAL_SIGNATURE && \
38-
php composer-setup.php && \
39-
php -r "unlink('composer-setup.php');"
40-
41-
RUN php composer.phar install && \
42-
vendor/bin/phpcs --standard=./phpcs-ruleset.xml && \
43-
vendor/bin/phpunit
44-
45-
RUN pecl install opencensus-alpha && \
46-
php -dextension=opencensus.so vendor/bin/phpunit
24+
ENTRYPOINT []

Dockerfile.integration

Lines changed: 0 additions & 20 deletions
This file was deleted.

circle.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

cloudbuild.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"opencensus/opencensus": "~0.4"
88
},
99
"require-dev": {
10-
"phpunit/phpunit": "^6.0",
10+
"phpunit/phpunit": "^5.0",
1111
"squizlabs/php_codesniffer": "2.*",
1212
"guzzlehttp/guzzle": "~6.0"
1313
},

integration-tests.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

scripts/dump_credentials.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

scripts/install_test_dependencies.sh

Lines changed: 0 additions & 76 deletions
This file was deleted.

scripts/run_test_suite.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)