forked from diesel-rs/diesel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
141 lines (140 loc) · 5.58 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
134
135
136
137
138
139
140
141
language: rust
dist: xenial
rust:
- stable
- beta
- nightly
cache:
directories:
- $HOME/.cargo
- $HOME/.rustup
before_cache:
- rm -rf /home/travis/.cargo/registry
addons:
postgresql: '9.5'
services:
- mysql
before_install:
# install sqlite3 version 3.24.0
- |
if [[ "$BACKEND" == sqlite ]]; then
(sudo apt-get update) &&
(wget --quiet -c https://sqlite.org/2020/sqlite-autoconf-3310100.tar.gz) &&
(tar zxf sqlite-autoconf-3310100.tar.gz;) &&
(cd sqlite-autoconf-3310100; \
CFLAGS="$CFLAGS -O2 -fno-strict-aliasing \
-DSQLITE_DEFAULT_FOREIGN_KEYS=1 \
-DSQLITE_SECURE_DELETE \
-DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_RTREE=1 \
-DSQLITE_SOUNDEX=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
-DSQLITE_OMIT_LOOKASIDE=1 \
-DSQLITE_ENABLE_DBSTAT_VTAB \
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 \
-DSQLITE_ENABLE_LOAD_EXTENSION \
-DSQLITE_ENABLE_JSON1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
-DSQLITE_MAX_SCHEMA_RETRY=25 \
-DSQLITE_ENABLE_PREUPDATE_HOOK \
-DSQLITE_ENABLE_SESSION \
-DSQLITE_ENABLE_STMTVTAB \
-DSQLITE_MAX_VARIABLE_NUMBER=250000" \
./configure --prefix=/usr \
--enable-threadsafe \
--enable-dynamic-extensions \
--libdir=/usr/lib/x86_64-linux-gnu \
--libexecdir=/usr/lib/x86_64-linux-gnu/sqlite3) &&
(cd sqlite-autoconf-3310100; sudo make; sudo make install)
fi
before_script:
- pip install 'travis-cargo<0.2' --user
- export PATH=$HOME/.local/bin:$PATH
- mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'travis'@'%';" -uroot
- rm rust-toolchain
script:
- |
rustc --version &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
(cd diesel && cargo test --no-default-features --features "unstable extras $BACKEND")
else
(cd diesel && cargo test --no-default-features --features "extras $BACKEND")
fi &&
(cd diesel && cargo test --no-default-features --features "extras with-deprecated $BACKEND") &&
(cd diesel_derives && cargo test --features "diesel/$BACKEND") &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
(cd diesel_derives && cargo test --features "diesel/unstable diesel/$BACKEND")
fi &&
(cd "examples/$BACKEND" && ./test_all) &&
(cd diesel_cli && cargo test --no-default-features --features "$BACKEND") &&
(cd diesel_migrations/migrations_internals && cargo test ) &&
(cd diesel_migrations/migrations_macros && cargo test --features "$BACKEND diesel/$BACKEND" ) &&
(cd diesel_migrations/ && cargo test --features "$BACKEND diesel/$BACKEND" ) &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
(cd diesel_tests && cargo test --no-default-features --features "unstable $BACKEND")
else
(cd diesel_tests && cargo test --no-default-features --features "$BACKEND")
fi
matrix:
allow_failures:
- rust: nightly
include:
- rust: nightly-2020-05-01
name: "Compile tests"
env: RUSTFLAGS="--cap-lints=warn"
script:
- (cd diesel_compile_tests && cargo test)
- rust: 1.40.0
name: "Rustfmt && Clippy"
script:
- rustup component add rustfmt clippy
- cargo clippy
- cargo fmt --all -- --check
- rust: stable
name: "Bundled Sqlite"
env:
- SQLITE_DATABASE_URL=/tmp/test.db
script:
- (cd diesel_cli && cargo test --no-default-features --features "sqlite-bundled")
- rust: 1.40.0
name: "Minimal supported rust version == 1.40.0"
script:
- cargo check --all
env:
matrix:
- BACKEND=sqlite
SQLITE_DATABASE_URL=/tmp/test.db
- BACKEND=postgres
PG_DATABASE_URL=postgres://postgres@localhost/
PG_EXAMPLE_DATABASE_URL=postgres://postgres@localhost/diesel_example
- BACKEND=mysql
MYSQL_DATABASE_URL=mysql://travis@localhost/diesel_test
MYSQL_EXAMPLE_DATABASE_URL=mysql://travis@localhost/diesel_example
MYSQL_UNIT_TEST_DATABASE_URL=mysql://travis@localhost/diesel_unit_test
RUST_TEST_THREADS=1
global:
- TRAVIS_CARGO_NIGHTLY_FEATURE=""
- secure: NmCM1VNEzid6bROA7tXV1R63n9S9KvY1etXsDzd1608cvjRnG3ZDAWXISbY1BxqrvleElreUJOvz/3TSQCHivpT2ezeyk2sntYtZpw0TWbz1SQMAPNWPTjP3bNQzpmNwfU4p6ui6qIOnQza4JxOu3SZSveNlehDBPkkS+52R7Zw/EPdwi9jTYJArV2+8pnEsQECAdRLttbtA2JBl3hZ4VHfGpHRZyeULn63UzyVbQVzQ3NVhqyQUKTPdpUciQTI3fZEkfaWuLV8QPPa5026/yJEEi2Fsl3r7fyY8ia67k4Zo9THlPVD0YOUlkWuZWwvkxNA8RQSVPv4FidEpwbxG8y6nAra4CjwiEChcpFhZJtrH7ZrXO/tJk7vtc5CFVWUsQtNX92QY1QFdPxwYNBSICLyUN+A+BQURwvQgxdcJsJyQmh5Ed7yuavcAinVq7fPeOyBWcPL5mt17no16aG1rzvXSUnD0aH7F3S3DHkoM9P9iHgJMLk+2YNmJtFescBxCeG8bA7t5bw0kQNH5KUWAD1uYpC9ikB3NVdlc+q17dKTAe4rcYA+sIO+UGudvpmLWT0lXtEMqDfxfCmyICDESs9bNfueCGJEAnfTBNunsJqR7rMUvjNndS2/Ssok6c/0Yfb9X8cM9nI4QLAj/+hClqdYphmpCjuC34bWxFSt/KJI=
after_success:
- |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
(cd diesel && cargo doc --features "postgres sqlite mysql extras")
mkdir diesel/target
mv target/doc diesel/target/doc
echo "docs.diesel.rs" > diesel/target/doc/CNAME
(cd diesel && travis-cargo doc-upload)
fi
branches:
only:
- master
- ಠ_ಠ
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/1d32e0ad32841bd56b02
on_success: change
on_failure: always
on_start: never