-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
133 lines (117 loc) · 4.63 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
language: c
cache:
ccache: true
# directories:
# - $HOME/Library/Caches/Homebrew
# not work
# env:
# jobs:
# # - CHANNEL=stable
# - CHANNEL=devel
matrix:
include:
- name: linux with mysql8
env: DB=MYSQL8 DOCKER=true CHANNEL=devel
# USE_SHA2=true
dist: xenial
services:
- docker
before_install:
- docker pull mysql:8.0
- docker run -d -p 127.0.0.1:3306:3306
-v $(pwd)/.travis/docker-entrypoint-initdb:/docker-entrypoint-initdb.d
--name mysqld
-e MYSQL_DATABASE=test
-e MYSQL_USER=test_user
-e MYSQL_PASSWORD=12345678
-e MYSQL_ROOT_PASSWORD=''
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes
mysql:8.0 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1 --default-authentication-plugin=mysql_native_password
# Build and test against the master (stable) and devel branches of Nim
- os: linux
name: linux with mysql(5.7.30)
env: CHANNEL=devel
compiler: gcc
services:
mysql # mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
- os: linux
name: linux with mariadb(10.4)
env: CHANNEL=devel
compiler: gcc
addons:
mariadb: '10.4'
# On OSX we only test against clang (gcc is mapped to clang by default)
# - os: osx
# name: osx with mysql(8.0.21)
# env: CHANNEL=devel
# compiler: clang
# # env: USE_SHA2=true
# before_install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# - brew install mysql # mysql-8.0.21
# - mysql.server start
# - os: osx
# name: osx with mariadb(10.5.5)
# compiler: clang
# # mariadb-10.5.5.high_sierra.bottle.tar.gz
# env: CHANNEL=devel TRAVIS_MARIADB_VERSION=10.5.5
# before_install:
# - brew install ccache
# - rm -f /etc/my.cnf
# - brew install mariadb
# - brew services start mariadb
allow_failures:
# Ignore failures when building against the devel Nim branch
# Also ignore OSX, due to very long build queue
- os: osx
- env: CHANNEL=devel USE_SHA2=true
# - name: osx with mysql
fast_finish: true
before_script:
# env(DB) = MYSQL8
# - |
# if [ -z "$TRAVIS_MARIADB_VERSION" ]
# then
# sudo systemctl stop mysql
# sudo mysqld_safe --skip-grant-tables --skip-networking &
# # mariadb 10.4 and later replace to mysql.global_priv https://mariadb.com/kb/en/mysqluser-table/
# # sudo mysql -u root -e "use mysql;UPDATE user SET authentication_string = PASSWORD('123456') WHERE User = 'root' AND Host = '127.0.0.1';UPDATE user SET password = PASSWORD('123456') WHERE User = 'root' AND Host = '127.0.0.1';FLUSH PRIVILEGES;"
# sudo mysql -u root -e "UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';FLUSH PRIVILEGES;"
# sudo systemctl start mysql;
# fi
- |
if [ -z "$DOCKER" ]
then
sudo mysql -u root -e "create database if not exists test;"
if [ -z "$TRAVIS_MARIADB_VERSION" ]
then
sudo mysql -u root -e "create user 'test_user'@'127.0.0.1' identified WITH mysql_native_password BY '12345678';"
if [ "$USE_SHA2" == "true" ]
then
sudo mysql -u root -e "CREATE USER 'sha2user'@'127.0.0.1' IDENTIFIED WITH caching_sha2_password BY 'password';"
sudo mysql -u root -e "grant all on *.* to 'sha2user'@'127.0.0.1';"
fi
else
sudo mysql -u root -e "create user 'test_user'@'127.0.0.1' identified VIA mysql_native_password USING PASSWORD('12345678');"
# mariadb not well support https://mariadb.com/kb/en/authentication-plugin-sha-256/#client-authentication-plugins
# sudo mysql -u root -e "CREATE USER 'sha2user'@'127.0.0.1' IDENTIFIED VIA caching_sha2_password USING PASSWORD('12345678');"
fi
sudo mysql -u root -e "grant all on *.* to 'test_user'@'127.0.0.1';"
sudo mysql -u root -e "grant FILE on *.* to 'test_user'@'127.0.0.1';"
fi
install:
- export CHOOSENIM_NO_ANALYTICS=1
# - export CHOOSENIM_CHOOSE_VERSION=1.3.1
- curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
- sh init.sh -y
- export PATH=~/.nimble/bin:$PATH
- echo "export PATH=~/.nimble/bin:$PATH" >> ~/.profile
- choosenim $CHANNEL
- nimble install https://github.com/bung87/zstd
- nimble install -d -y
script:
- nimble test --silent
- nimble test -d:ChronosAsync --silent
# - nimble install scorper
# - nim c -d:useServer -r experiments/test_concurrent.nim