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

Commit b20205e

Browse files
authored
Switch to Circle CI version 2.0 (#176)
* Try Circle CI 2.0 * Remove circle 1.0 scripts * Fix extension test runner * Run extension tests in single run statement * skip extension tests for php 5.6 * Fix dependencies for PHP 5.6 * Run on zts, 32 bit and debug images * Install build tools if not installed * Fix syntax * Need sudo for apt-get install * Skip sudo if you're root * Configure when sudo is required for build * Fix env config overriding
1 parent c26ab86 commit b20205e

File tree

10 files changed

+175
-246
lines changed

10 files changed

+175
-246
lines changed

.circleci/config.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
unit-config: &unit-config
2+
environment:
3+
TEST_PHP_ARGS: -q
4+
REPORT_EXIT_STATUS: 1
5+
RUN_EXTENSION_TESTS: 1
6+
SUDO_CMD: "sudo"
7+
steps:
8+
- checkout
9+
10+
- run:
11+
name: Install build tools
12+
command: |
13+
autoconf -V || \
14+
(
15+
$SUDO_CMD apt-get update -y && \
16+
$SUDO_CMD apt-get install -y -q --no-install-recommends \
17+
build-essential \
18+
g++ \
19+
gcc \
20+
libc-dev \
21+
make \
22+
autoconf \
23+
git \
24+
unzip
25+
)
26+
27+
- run:
28+
name: Extension unit tests
29+
command: |
30+
if [ $RUN_EXTENSION_TESTS -eq "1" ]; then
31+
pushd ext
32+
phpize
33+
./configure --enable-opencensus
34+
make test || ((find . -name '*.diff' | xargs cat) && false)
35+
$SUDO_CMD make install
36+
popd
37+
else
38+
echo "Skipping extension tests"
39+
fi
40+
41+
# Download and cache dependencies
42+
- restore_cache:
43+
keys:
44+
- v1-dependencies-{{ checksum "composer.json" }}
45+
# fallback to using the latest cache if no exact match is found
46+
- v1-dependencies-
47+
48+
- run:
49+
name: Install composer packages
50+
command: composer install -n --prefer-dist
51+
52+
- save_cache:
53+
paths:
54+
- ./vendor
55+
key: v1-dependencies-{{ checksum "composer.json" }}
56+
57+
- run:
58+
name: Enable E_ALL error reporting for strict testing
59+
command: $SUDO_CMD cp config/php.ini /usr/local/etc/php
60+
61+
- run:
62+
name: PHP Code Style
63+
command: vendor/bin/phpcs --standard=./phpcs-ruleset.xml
64+
65+
- run:
66+
name: PHP unit tests
67+
command: vendor/bin/phpunit
68+
69+
- run:
70+
name: PHP unit tests with extension
71+
command: |
72+
if [ $RUN_EXTENSION_TESTS -eq "1" ]; then
73+
php -d extension=opencensus.so vendor/bin/phpunit
74+
else
75+
echo "Skipping units tests with extension"
76+
fi
77+
78+
version: 2
79+
jobs:
80+
php56:
81+
<<: *unit-config
82+
docker:
83+
- image: circleci/php:5.6-node
84+
environment:
85+
RUN_EXTENSION_TESTS: 0
86+
SUDO_CMD: "sudo"
87+
88+
php56-zts:
89+
<<: *unit-config
90+
docker:
91+
- image: circleci/php:5.6-zts-node
92+
environment:
93+
RUN_EXTENSION_TESTS: 0
94+
SUDO_CMD: "sudo"
95+
96+
php70:
97+
<<: *unit-config
98+
docker:
99+
- image: circleci/php:7.0-node
100+
101+
php70-zts:
102+
<<: *unit-config
103+
docker:
104+
- image: circleci/php:7.0-zts-node
105+
106+
php71:
107+
<<: *unit-config
108+
docker:
109+
- image: circleci/php:7.1-node
110+
111+
php71-zts:
112+
<<: *unit-config
113+
docker:
114+
- image: circleci/php:7.1-zts-node
115+
116+
php72:
117+
<<: *unit-config
118+
docker:
119+
- image: circleci/php:7.2-node
120+
121+
php72-zts:
122+
<<: *unit-config
123+
docker:
124+
- image: circleci/php:7.2-zts-node
125+
126+
php70-32bit:
127+
<<: *unit-config
128+
docker:
129+
- image: gcr.io/php-stackdriver/php70-32bit
130+
environment:
131+
TEST_PHP_ARGS: -q
132+
REPORT_EXIT_STATUS: 1
133+
RUN_EXTENSION_TESTS: 1
134+
SUDO_CMD: ""
135+
136+
php71-32bit:
137+
<<: *unit-config
138+
docker:
139+
- image: gcr.io/php-stackdriver/php71-32bit
140+
environment:
141+
TEST_PHP_ARGS: -q
142+
REPORT_EXIT_STATUS: 1
143+
RUN_EXTENSION_TESTS: 1
144+
SUDO_CMD: ""
145+
146+
php71-debug:
147+
<<: *unit-config
148+
docker:
149+
- image: gcr.io/php-stackdriver/php71-debug
150+
environment:
151+
TEST_PHP_ARGS: -q
152+
REPORT_EXIT_STATUS: 1
153+
RUN_EXTENSION_TESTS: 1
154+
SUDO_CMD: ""
155+
156+
workflows:
157+
version: 2
158+
units:
159+
jobs:
160+
- php56
161+
- php56-zts
162+
- php70
163+
- php70-zts
164+
- php71
165+
- php71-zts
166+
- php72
167+
- php72-zts
168+
- php70-32bit
169+
- php71-32bit
170+
- php71-debug

Dockerfile

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

circle.yml

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

cloudbuild.yaml

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

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
],
1212
"minimum-stability": "stable",
1313
"require": {
14-
"php": ">=5.5",
14+
"php": ">=5.6",
1515
"ramsey/uuid": "~3",
1616
"psr/log": "^1.0",
1717
"psr/cache": "^1.0",
1818
"cache/adapter-common": "^1.0"
1919
},
2020
"require-dev": {
21-
"phpunit/phpunit": ">= 6.0",
21+
"phpunit/phpunit": "^5.0",
2222
"squizlabs/php_codesniffer": "2.*",
2323
"google/cloud-trace": "^0.4",
24-
"twig/twig": "~2.0",
24+
"twig/twig": "~2.0 || ~1.35",
2525
"symfony/yaml": "~3.3",
2626
"guzzlehttp/guzzle": "~5.3"
2727
},

scripts/dump_credentials.php

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

0 commit comments

Comments
 (0)