forked from pgjdbc/pgjdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
238 lines (227 loc) · 7.4 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
sudo: false
language: java
dist: trusty
branches:
except:
- /^tmp\/.*/
- /^REL.*/
stages:
- name: test
if: not branch =~ ^release\/.*$
- name: release
# releases pgjdbc for Java 8
# It does set release tag and update pom.xml versions
if: branch =~ ^release\/.*$
- name: release_prev
# releases pgjdbc for Java 6, Java 7
# pgjdbc-jreX requires release pom.xml versions of the main project, so pgjdbc-jreX should be
# released after the release of the main version, thus second stage
if: branch =~ ^release\/.*$
before_script:
- test $(grep "after_n_builds" codecov.yml | tr -d '[:space:]' | cut -d":" -f2) -eq $(grep -e "COVERAGE=Y$" .travis.yml | wc -l) || exit 1
- export PG_DATADIR="/etc/postgresql/${PG_VERSION}/main"
- export PG_SLAVE1_DATADIR="/etc/postgresql/${PG_VERSION}/slave1"
- export PG_SLAVE2_DATADIR="/etc/postgresql/${PG_VERSION}/slave2"
- ./.travis/travis_install_postgres.sh
- test "x$XA" == 'x' || ./.travis/travis_configure_xa.sh
- test "x$REPLICATION" == 'x' || ./.travis/travis_configure_replication.sh
- test "x$SSLTEST" == 'x' || ./.travis/travis_configure_ssl.sh
- ./.travis/travis_start_postgres.sh
- test "x$PG_VERSION" != 'xHEAD' || psql -U postgres -c "set password_encryption='scram-sha-256'; create user test with password 'test';"
- test "x$PG_VERSION" = 'xHEAD' || psql -U postgres -c "create user test with password 'test';"
- test "x$REPLICATION" == 'x' || psql -U postgres -c "alter user test with replication;"
- psql -c 'create database test owner test;' -U postgres
- test "x$SSLTEST" == 'x' || ./.travis/travis_ssl_users.sh
- test "x$REPLICATION" == 'x' || ./.travis/travis_create_slaves.sh
- if [[ $TRAVIS_BRANCH == release/* ]]; then echo "MAVEN_OPTS='-Xmx1g'" > ~/.mavenrc; else echo "MAVEN_OPTS='-Xmx1g -Dgpg.skip=true'" > ~/.mavenrc; fi
- test "x$PG_VERSION" == 'x' || test "x$NO_HSTORE" == 'xY' || psql test -c 'CREATE EXTENSION hstore;' -U postgres
- test "x$PG_VERSION" == 'x' || test "x$CREATE_PLPGSQL" == 'x' || createlang -U postgres plpgsql test
- test "x$PG_VERSION" == 'x' || test "x$PLPGSQL_EXTENSION" == 'x' || psql test -c 'CREATE EXTENSION IF NOT EXISTS plpgsql;' -U postgres
env:
global:
- secure: "NI+aqwRLLVt2feJdk/2ZEZnsaPyu+vOx8MahVxjz0UUVvRHVqxM5O1M0R53NJfEeIjflOzgZJwRLqgyl6dkdfjytRhaHWGptQdehV4cwNb+4epnn8WlpRzMac65zTQqnbGVtw9jissDQv6/Zl/+D+DMcU65BbFZkix40whILXG0="
before_install:
- ./.travis/travis_install_zulu.sh
- test -z "${ZULU_JDK}" || export JDK${ZULU_JDK}_HOME=/usr/lib/jvm/zulu-${ZULU_JDK}-amd64
- unset _JAVA_OPTIONS # see https://github.com/travis-ci/travis-ci/issues/8408
script:
# make sure previous build artifacts are not used for subsequent builds
- rm -rf $HOME/.m2/repository/org/postgresql || true
- test -d "${JDK8_HOME}" || export JDK8_HOME=$(jdk_switcher home oraclejdk8)
- test -d "${JDK14_HOME}" || export JDK14_HOME=$(jdk_switcher home oraclejdk14)
- test ${JDK} -eq 7 || jdk_switcher use oraclejdk8 # Run Gradle with Java 8, build with Toolchains.
- test -z "${ZULU_JDK}" || export TRAVIS_JDK_VERSION=zulujdk${ZULU_JDK} # trick codecov to use correct jdk version
- if [[ $TRAVIS_BRANCH == release/* ]]; then .travis/travis_release.sh; else ./.travis/travis_build.sh; fi
- ./.travis/travis_check_postgres_health.sh
# To avoid useless S3 cache updates (https://github.com/travis-ci/travis-ci/issues/1441#issuecomment-67607074)
#- mkdir /tmp/cache-trick
#- mv $HOME/.m2/repository/org/postgresql /tmp/cache-trick/
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete
# No sense in caching current build artifacts
- rm -rf $HOME/.m2/repository/org/postgresql
# Skip default "mvn install" issued by Travis
# Root project cannot be compiled with older JDKs, so it makes sense to just skip the step
install: true
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.m2/repository
- $HOME/.ivy2/cache
- $HOME/.sbt/boot/
matrix:
fast_finish: true
include:
- stage: test
env:
- FEDORA_CI=Y
services:
- docker
if: type != pull_request
- jdk: openjdk-ea
sudo: required
addons:
postgresql: "10"
env:
- PG_VERSION=10
- JDK=12
- TZ=America/New_York # flips between −05:00 and −04:00
- BUILD_SCAN=Y
- jdk: openjdk-ea
sudo: required
addons:
postgresql: "11"
env:
- PG_VERSION=11
- XA=true
- COVERAGE=Y
- NO_HSTORE=Y
- PLPGSQL_EXTENSION=Y
- jdk: oraclejdk14
sudo: required
addons:
postgresql: "11"
env:
- PG_VERSION=11
- XA=true
- COVERAGE=Y
- NO_HSTORE=Y
- PLPGSQL_EXTENSION=Y
- JDK=14
- jdk: oraclejdk8
sudo: required
addons:
postgresql: "11"
env:
- PG_VERSION=11
- XA=true
- COVERAGE=Y
- NO_HSTORE=Y
- PLPGSQL_EXTENSION=Y
- JDK=8
- BUILD_SCAN=Y
- jdk: oraclejdk11
sudo: required
addons:
postgresql: "10"
env:
- PG_VERSION=10
- JDK=11
- TZ=America/New_York # flips between −05:00 and −04:00
- SLOW_TESTS=Y
- jdk: oraclejdk14
addons:
postgresql: "9.6"
env:
- PG_VERSION=9.6
- JDK=14
- TZ=America/New_York # flips between −05:00 and −04:00
- jdk: oraclejdk8
sudo: required
env:
- PG_VERSION=HEAD
- XA=true
- REPLICATION=Y
- COVERAGE=Y
- TEST_CLIENTS=Y
- TZ=Pacific/Chatham # flips between +12:45 and +13:45
- JDK=8
- SLOW_TESTS=Y
- jdk: oraclejdk8
sudo: required
addons:
postgresql: "9.6"
env:
- PG_VERSION=9.6
- ZULU_JDK=8
- XA=true
- REPLICATION=Y
- COVERAGE=Y
- MCENTRAL=Y
- JDOC=Y
- jdk: oraclejdk8
sudo: required
addons:
postgresql: "9.5"
env:
- PG_VERSION=9.5
- XA=true
- REPLICATION=Y
- JDK=8
- jdk: oraclejdk8
addons:
postgresql: "9.4"
env:
- PG_VERSION=9.4
- QUERY_MODE=extendedCacheEverything
- COVERAGE=Y
- TZ=Europe/Moscow # +03:00, no DST
- JDK=8
- jdk: oraclejdk8
sudo: required
addons:
postgresql: "10"
env:
- PG_VERSION=10
- SSLTEST=Y
- COVERAGE=Y
- JDK=8
- jdk: oraclejdk8
sudo: required
env:
- PG_VERSION=8.4
- XA=true
- COVERAGE=Y
- NO_HSTORE=Y
- CREATE_PLPGSQL=Y
- jdk: oraclejdk8
addons:
postgresql: "9.6"
env:
- PG_VERSION=9.6
- QUERY_MODE=simple
- COVERAGE=Y
- TEST_CLIENTS=Y
- JDK=8
- jdk: oraclejdk8
addons:
postgresql: "9.3"
env:
- PG_VERSION=9.3
- QUERY_MODE=extendedForPrepared
- COVERAGE=Y
- JDK=8
- jdk: oraclejdk8
addons:
postgresql: "9.4"
env:
- PG_VERSION=9.4
- NO_WAFFLE_NO_OSGI=Y
- JDK=8
# Deploy snapshots to Maven Central
after_success:
- "test $TRAVIS_PULL_REQUEST == 'false' && test $TRAVIS_BRANCH == 'master' && test $MCENTRAL == 'Y' && ./.travis/travis_deploy.sh"