-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
91 lines (84 loc) · 2.79 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
stages:
- Test
# Select what we should cache
cache:
paths:
- vendor/
before_script:
# Install git and unzip (composer will need them)
- apt-get update && apt-get install -qqy git unzip zlib1g-dev libzip-dev
# install php extensions
- docker-php-ext-install zip
# Install composer
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install all project dependencies
- composer install
# Run webserver
- php -S 0.0.0.0:8134 -t doc/ 2> /dev/null &
# Test
test:7.0:
image: php:7.0
services:
- name: selenium/standalone-chrome
alias: selenium
stage: Test
script:
# Get container ip address
- ADDRESS=`awk -v hostname="$HOSTNAME" '{if ($2 == hostname) print $1;}' /etc/hosts`
# Run webserver
- php -S 0.0.0.0:8134 -t doc/ 2> /dev/null &
# Replace address in CodeCeption config
- sed -i "s/localhost:8134/$ADDRESS:8134/" tests/acceptance.suite.yml
# Replace host in codeception config
- sed -i "s/host:\ localhost/host:\ selenium/" tests/acceptance.suite.yml
# run tests
- vendor/bin/codecept run
test:7.1:
image: php:7.1
services:
- name: selenium/standalone-chrome
alias: selenium
stage: Test
script:
# Get container ip address
- ADDRESS=`awk -v hostname="$HOSTNAME" '{if ($2 == hostname) print $1;}' /etc/hosts`
# Replace address in CodeCeption config
- sed -i "s/localhost:8134/$ADDRESS:8134/" tests/acceptance.suite.yml
# Replace host in codeception config
- sed -i "s/host:\ localhost/host:\ selenium/" tests/acceptance.suite.yml
# run tests
- vendor/bin/codecept run
test:7.2:
image: php:7.2
services:
- name: selenium/standalone-chrome
alias: selenium
stage: Test
script:
# Get container ip address
- ADDRESS=`awk -v hostname="$HOSTNAME" '{if ($2 == hostname) print $1;}' /etc/hosts`
# Run webserver
- php -S 0.0.0.0:8134 -t doc/ 2> /dev/null &
# Replace address in CodeCeption config
- sed -i "s/localhost:8134/$ADDRESS:8134/" tests/acceptance.suite.yml
# Replace host in codeception config
- sed -i "s/host:\ localhost/host:\ selenium/" tests/acceptance.suite.yml
# run tests
- vendor/bin/codecept run
test:7.3:
image: php:7.3
services:
- name: selenium/standalone-chrome
alias: selenium
stage: Test
script:
# Get container ip address
- ADDRESS=`awk -v hostname="$HOSTNAME" '{if ($2 == hostname) print $1;}' /etc/hosts`
# Run webserver
- php -S 0.0.0.0:8134 -t doc/ 2> /dev/null &
# Replace address in CodeCeption config
- sed -i "s/localhost:8134/$ADDRESS:8134/" tests/acceptance.suite.yml
# Replace host in codeception config
- sed -i "s/host:\ localhost/host:\ selenium/" tests/acceptance.suite.yml
# run tests
- vendor/bin/codecept run