Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87117e6

Browse files
committed
codeship: run tests on PHP 7.1 7.2 and 7.3
1 parent 8b5ec78 commit 87117e6

6 files changed

Lines changed: 80 additions & 25 deletions

File tree

codeship-services.yml

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,77 @@ deploy:
3838
DEPLOYMENT_RULES_VERSION: master
3939
DEPLOYMENT_RULES_FILE: platform.yml
4040

41-
test:
42-
build:
43-
image: test
41+
42+
mysql/base: &_mysql_base
43+
image: mysql:5.7
44+
environment:
45+
- MYSQL_DATABASE=ushahidi
46+
- MYSQL_USER=ushahidi
47+
- MYSQL_PASSWORD=ushahidi
48+
- MYSQL_ROOT_PASSWORD=root
49+
mysql-7.1:
50+
<<: *_mysql_base
51+
mysql-7.2:
52+
<<: *_mysql_base
53+
mysql-7.3:
54+
<<: *_mysql_base
55+
56+
57+
test/base: &_test_defaults
58+
build: &_test_build_defaults
4459
dockerfile_path: docker/test.Dockerfile
4560
volumes:
4661
- .:/vols/src
47-
depends_on:
48-
- mysql
49-
environment:
50-
- DB_HOST=mysql
51-
- DB_PORT=3306
52-
- DB_DATABASE=ushahidi
53-
- DB_USERNAME=ushahidi
54-
- DB_PASSWORD=ushahidi
55-
- KOHANA_ENV=testing
62+
environment: &_test_env_defaults
63+
DB_PORT: 3306
64+
DB_DATABASE: ushahidi
65+
DB_USERNAME: ushahidi
66+
DB_PASSWORD: ushahidi
67+
KOHANA_ENV: testing
5668
extra_hosts:
5769
- "ushahidi.dev:127.0.0.1"
5870
cached: true
5971
default_cache_branch: develop
6072

61-
mysql:
62-
image: mysql:5.7
73+
test/php-7.1:
74+
<<: *_test_defaults
75+
build:
76+
<<: *_test_build_defaults
77+
image: test-7.1
78+
args:
79+
PHP_MAJOR_VERSION: "7.1"
6380
environment:
64-
- MYSQL_DATABASE=ushahidi
65-
- MYSQL_USER=ushahidi
66-
- MYSQL_PASSWORD=ushahidi
67-
- MYSQL_ROOT_PASSWORD=root
81+
<<: *_test_env_defaults
82+
DB_HOST: mysql-7.1
83+
depends_on:
84+
- mysql-7.1
85+
86+
test/php-7.2:
87+
<<: *_test_defaults
88+
build:
89+
<<: *_test_build_defaults
90+
image: test-7.2
91+
args:
92+
PHP_MAJOR_VERSION: "7.2"
93+
environment:
94+
<<: *_test_env_defaults
95+
DB_HOST: mysql-7.2
96+
depends_on:
97+
- mysql-7.2
98+
99+
test/php-7.3:
100+
<<: *_test_defaults
101+
build:
102+
<<: *_test_build_defaults
103+
image: test-7.3
104+
args:
105+
PHP_MAJOR_VERSION: "7.3"
106+
depends_on:
107+
- mysql-7.3
108+
environment:
109+
<<: *_test_env_defaults
110+
DB_HOST: mysql-7.3
111+
68112

69113
aglio:
70114
image: humangeo/aglio

codeship-steps.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
- name: "Test"
2-
service: test
3-
command: test_reporter composer run test --timeout 0
2+
type: parallel
3+
steps:
4+
- name: "Test PHP 7.1"
5+
service: test/php-7.1
6+
command: test_reporter composer run test --timeout 0
7+
- name: "Test PHP 7.2"
8+
service: test/php-7.2
9+
command: test_reporter composer run test --timeout 0
10+
- name: "Test PHP 7.3"
11+
service: test/php-7.3
12+
command: test_reporter composer run test --timeout 0
13+
414

515
- type: parallel
616
steps:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=7.0 <=7.3",
18+
"php": ">=7.0 <7.4",
1919
"aura/di": "~3.4",
2020
"league/flysystem-aws-s3-v3": "~1.0",
2121
"league/flysystem-rackspace": "~1.0",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ function run_composer_install {
6363
}
6464

6565
function wait_for_mysql {
66-
local db_host=${DB_HOST:-mysql}
66+
local db_host=${DB_HOST}
6767
local db_port=${DB_PORT:-3306}
6868
until nc -z $db_host $db_port; do
69-
>&2 echo "Mysql is unavailable - sleeping"
69+
>&2 echo "Mysql ($db_host:$db_port) is unavailable - sleeping"
7070
sleep 1
7171
done
7272
}

docker/test.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ushahidi/php-ci:php-7.0
1+
ARG PHP_MAJOR_VERSION
2+
FROM ushahidi/php-ci:php-${PHP_MAJOR_VERSION}
23

34
WORKDIR /var/www
45
COPY composer.json ./

0 commit comments

Comments
 (0)