-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (38 loc) · 1.52 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
language: go
os: linux
dist: bionic
go:
- 1.19.x
notifications:
email:
on_success: change
on_failure: change
env:
- RELEASE=master SLEEP=60 DO_IMPORT=1 ENGINE=sqlite PORT=8780 APPDIR=/tmp/appdir/sqlite LOC=/tmp/appdir/sqlite
- RELEASE=master SLEEP=60 DO_IMPORT=1 ENGINE=mariadb PORT=8780 APPDIR=/tmp/appdir/mariadb LOC='speechoid:@tcp(127.0.0.1:3306)'
script:
- set -e
- sudo apt-get install mariadb-client mariadb-server siege
- cat go.mod
#- sudo mysql -u root < scripts/mariadb_setup.sql
#- go get github.com/securego/gosec/cmd/gosec
#- sudo snap install gosec
#- gosec ./...
#- go get honnef.co/go/tools/cmd/staticcheck
#- staticcheck ./...
# need mariadb for unit tests below to work properly
- bash scripts/setup.sh -a /tmp/appdir/mariadb -e mariadb -l 'speechoid:@tcp(127.0.0.1:3306)'
- bash scripts/setup.sh -a /tmp/appdir/sqlite -e sqlite -l /tmp/appdir/sqlite
- go test -v ./...
- |
if [ -v DO_IMPORT ]; then
bash scripts/import.sh -e $ENGINE -f wikispeech-lexdata -a $APPDIR -r $RELEASE -l $LOC
fi
- bash scripts/start_server.sh -a $APPDIR -e $ENGINE -l $LOC -p $PORT &
- export pid=$!
- echo "pronlex $ENGINE server started on pid $pid. wait for $SLEEP seconds before shutting down"
- sleep $SLEEP
- siege "http://localhost:8780/lexicon/lookup?lexicons=sv_se_nst_lex:sv-se.nst&words=vi%20testar%20talsyntes" -r10 -50 &> /tmp/siege.log
- cat /tmp/siege.log
- egrep Failed /tmp/siege.log | cut -f2 | egrep -cw 0
- sh .travis/exit_server_and_fail_if_not_running.sh pronlex $pid