forked from pBlueG/SA-MP-MySQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (59 loc) · 2.49 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
language: cpp
sudo: required
dist: trusty
env:
global:
- SAMP_SERVER_ROOT=$TRAVIS_BUILD_DIR/samp03
- PATH=$TRAVIS_BUILD_DIR/samp-server-cli:$PATH
matrix:
- STATIC_BUILD=ON BUILD_TYPE=Release
- STATIC_BUILD=ON BUILD_TYPE=Debug
- STATIC_BUILD=OFF BUILD_TYPE=Release
- STATIC_BUILD=OFF BUILD_TYPE=Debug
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
- cmake
- g++-multilib
cache:
directories:
- mysql-connector-c-6.1.6-src
before_install:
- if [ ! -f "mysql-connector-c-6.1.6-src/CMakeLists.txt" ]; then wget "http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-6.1.6-src.tar.gz"; fi
- if [ ! -f "mysql-connector-c-6.1.6-src/CMakeLists.txt" ]; then tar xzf mysql-connector-c-6.1.6-src.tar.gz; fi
- wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
- tar xzf boost_1_64_0.tar.gz
- wget http://files.sa-mp.com/samp037svr_R2-1.tar.gz
- tar xzf samp037svr_R2-1.tar.gz
- wget http://files.sa-mp.com/samp037_svr_R2-1-1_win32.zip
- unzip samp037_svr_R2-1-1_win32.zip -d $SAMP_SERVER_ROOT pawno/include/*
- git clone https://github.com/Zeex/samp-server-cli.git
- wget https://github.com/Zeex/pawn/releases/download/20150531/pawnc-3.10.20150531-linux.tar.gz
- sudo tar xvf pawnc-3.10.20150531-linux.tar.gz --strip-components=1 -C /usr/local
- sudo ldconfig
install:
- cd mysql-connector-c-6.1.6-src/
- cmake . -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32 -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_LAYOUT=DEB > /dev/null
- make -j2 > /dev/null
- sudo make install > /dev/null
- sudo ldconfig
- cd ..
before_script:
- mysql -u root -e "CREATE DATABASE IF NOT EXISTS test;"
- mysql -u root -e "CREATE USER 'tester'@'127.0.0.1' IDENTIFIED BY '1234';"
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'tester'@'127.0.0.1' WITH GRANT OPTION;"
- cmake . -DCMAKE_INSTALL_PREFIX=${SAMP_SERVER_ROOT} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBOOST_ROOT=boost_1_64_0 -DBUILD_TESTS=ON -DBUILD_STATIC=${STATIC_BUILD}
script:
- make -j2
- make install
# tests
- pawncc tests/unit_test.pwn -d3 -Z+ -\; -\( -i${SAMP_SERVER_ROOT}/pawno/include -itests/include -ounit_test
- cp -R tests/test_data/* ${SAMP_SERVER_ROOT}
- cp *.amx ${SAMP_SERVER_ROOT}/gamemodes
- samp-server-cli -o -g unit_test -d mysql.so -T 60
after_script: cat ${SAMP_SERVER_ROOT}/logs/plugins/mysql.log
before_cache:
- rm -f mysql-connector-c-6.1.6-src/Docs/INFO_BIN