-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
75 lines (66 loc) · 2.38 KB
/
.travis.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
language: php
dist: "bionic"
php:
- "7.4"
install:
# install python3
- sudo apt-get update
- sudo apt-get -qq install python3
- sudo apt-get -qq install python3-pip
- pip3 -q install --upgrade pip
# install apache2 and fcgi
- sudo apt-get -qq install apache2
- wget https://mirrors.edge.kernel.org/ubuntu/pool/multiverse/liba/libapache-mod-fastcgi/libapache2-mod-fastcgi_2.4.7~0910052141-1.2_amd64.deb
- sudo dpkg -i libapache2-mod-fastcgi_2.4.7~0910052141-1.2_amd64.deb
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias mime headers
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f tests/.config/travis/apache.conf /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%CI_WORKSPACE%?$(pwd)?g" --in-place tests/.config/config.json
- sudo systemctl restart apache2 || sudo systemctl status apache2 || sudo journalctl -xe
# install python dependencies
- pip3 -q install --upgrade colorama requests
before_script:
# get some information
- php --version
- python3 --version
- pwd
# change cwd to tests
- cd tests
# add executeable flag
- sudo chmod ugo+x config.sh
- sudo chmod ugo+x run.sh
# test files init
- sudo ./config.sh --init
matrix:
include:
- name: "API Test (PHP 7.1)"
language: php
php: 7.1
env: TEST_SUITE=API
- name: "logParser Test (PHP 7.1)"
language: php
php: 7.1
env: TEST_SUITE=logParser
- name: "API Test (PHP 7.4)"
language: php
php: 7.4
env: TEST_SUITE=API
- name: "logParser Test (PHP 7.4)"
language: php
php: 7.4
env: TEST_SUITE=logParser
# add your test here. ex:
# - name: "myVeryCool Test"
# env: TEST_SUITE=coolTest
script: ./run.sh $TEST_SUITE -q
after_script:
- sudo ./config.sh --restore
- cd ..
- sudo cat /var/log/apache2/error.log