summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 4ee9832bf0179bb4df67dc84ed72384aba2b140a (plain)
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
# Redmine runs tests on own continuous integration server.
# http://www.redmine.org/projects/redmine/wiki/Continuous_integration
# You can also run tests on your environment.
language: ruby
rvm:
  - 1.9.3
  - 2.0
  - 2.1
  - 2.2
  - jruby-9.0.1.0
  - jruby
env:
  - "SUITE=units       DB=postgresql"
  - "SUITE=functionals DB=postgresql"
  - "SUITE=integration DB=postgresql"
  - "SUITE=ui          DB=postgresql"
  - "SUITE=units       DB=postgresql-8.4"
  - "SUITE=functionals DB=postgresql-8.4"
  - "SUITE=integration DB=postgresql-8.4"
  - "SUITE=ui          DB=postgresql-8.4"
  - "SUITE=units       DB=postgresql-9.1"
  - "SUITE=functionals DB=postgresql-9.1"
  - "SUITE=integration DB=postgresql-9.1"
  - "SUITE=ui          DB=postgresql-9.1"
  - "SUITE=units       DB=postgresql-9.2"
  - "SUITE=functionals DB=postgresql-9.2"
  - "SUITE=integration DB=postgresql-9.2"
  - "SUITE=ui          DB=postgresql-9.2"
  - "SUITE=units       DB=postgresql-9.3"
  - "SUITE=functionals DB=postgresql-9.3"
  - "SUITE=integration DB=postgresql-9.3"
  - "SUITE=ui          DB=postgresql-9.3"
  - "SUITE=units       DB=postgresql-9.4"
  - "SUITE=functionals DB=postgresql-9.4"
  - "SUITE=integration DB=postgresql-9.4"
  - "SUITE=ui          DB=postgresql-9.4"
  - "SUITE=units       DB=postgresql-9.5"
  - "SUITE=functionals DB=postgresql-9.5"
  - "SUITE=integration DB=postgresql-9.5"
  - "SUITE=ui          DB=postgresql-9.5"
  - "SUITE=units       DB=mysql-5.5"
  - "SUITE=functionals DB=mysql-5.5"
  - "SUITE=integration DB=mysql-5.5"
  - "SUITE=ui          DB=mysql-5.5"
  - "SUITE=units       DB=mysql-5.6"
  - "SUITE=functionals DB=mysql-5.6"
  - "SUITE=integration DB=mysql-5.6"
  - "SUITE=ui          DB=mysql-5.6"
  - "SUITE=units       DB=mysql-5.7-dmr"
  - "SUITE=functionals DB=mysql-5.7-dmr"
  - "SUITE=integration DB=mysql-5.7-dmr"
  - "SUITE=ui          DB=mysql-5.7-dmr"
  - "SUITE=units       DB=mariadb-5.5"
  - "SUITE=functionals DB=mariadb-5.5"
  - "SUITE=integration DB=mariadb-5.5"
  - "SUITE=ui          DB=mariadb-5.5"
  - "SUITE=units       DB=mariadb-10.0"
  - "SUITE=functionals DB=mariadb-10.0"
  - "SUITE=integration DB=mariadb-10.0"
  - "SUITE=ui          DB=mariadb-10.0"
  - "SUITE=units       DB=sqlite3"
  - "SUITE=functionals DB=sqlite3"
  - "SUITE=integration DB=sqlite3"
  - "SUITE=ui          DB=sqlite3"
matrix:
  allow_failures:
    # http://www.redmine.org/issues/20251
    - env: "SUITE=ui          DB=postgresql"
    - env: "SUITE=ui          DB=mysql-5.5"
    - env: "SUITE=ui          DB=mysql-5.6"
    - env: "SUITE=ui          DB=mysql-5.7-dmr"
    - env: "SUITE=ui          DB=mariadb-5.5"
    - env: "SUITE=ui          DB=mariadb-10.0"
    - env: "SUITE=ui          DB=sqlite3"
    - env: "SUITE=units       DB=mysql-5.7-dmr"
    - env: "SUITE=functionals DB=mysql-5.7-dmr"
    - env: "SUITE=integration DB=mysql-5.7-dmr"
    - env: "SUITE=ui          DB=postgresql-8.4"
    - env: "SUITE=ui          DB=postgresql-9.1"
    - env: "SUITE=ui          DB=postgresql-9.2"
    - env: "SUITE=ui          DB=postgresql-9.3"
    - env: "SUITE=ui          DB=postgresql-9.4"
    - env: "SUITE=ui          DB=postgresql-9.5"
    - rvm: jruby-9.0.1.0
    # SCM tests fail randomly due to IO.popen().
    # http://www.redmine.org/issues/19091
    # https://github.com/jruby/jruby/issues/779
    - rvm: jruby
    # http://www.redmine.org/issues/17460
    # http://www.redmine.org/issues/19344
    - env: "SUITE=units       DB=mysql-5.6"
    - env: "SUITE=units       DB=mysql-5.7-dmr"
    - env: "SUITE=units       DB=mariadb-5.5"
    - env: "SUITE=units       DB=mariadb-10.0"
before_install:
  # https://github.com/travis-ci/travis-ci/issues/4720
  - if [[ ${TRAVIS_RUBY_VERSION} =~ jruby-9\.0 ]] ;
    then
      rvm get master ;
      rvm use ${TRAVIS_RUBY_VERSION} --install ;
      ruby --version ;
    fi
  - "sudo apt-get update -qq"
  - "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion"
  - dpkg -l *mysql*
  - if [[ $DB =~ (mariadb|mysql-5\.[67]) ]] ;
    then
      sudo service mysql stop ;
      sudo apt-get install python-software-properties ;
      if [[ $DB =~ mariadb ]] ;
      then
        sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db ;
        MARIADB_VER=`echo $DB | sed -e 's/mariadb-//'` ;
        sudo add-apt-repository ''"deb http://ftp.osuosl.org/pub/mariadb/repo/${MARIADB_VER}/ubuntu precise main"'' ;
        sudo cp test/travis/mariadb.pref /etc/apt/preferences.d/mariadb.pref ;
        sudo apt-get update ;
        sudo DEBIAN_FRONTEND=noninteractive apt-get -q --yes --force-yes -f --option DPkg::Options::=--force-confnew install mariadb-server ;
        sudo apt-get install libmariadbd-dev ;
      else
        echo mysql-apt-config mysql-apt-config/enable-repo select $DB | sudo debconf-set-selections ;
        wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb ;
        sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb ;
        sudo apt-get update -q ;
        sudo apt-get install -q -y -o Dpkg::Options::=--force-confnew mysql-server ;
      fi
    elif [[ $DB =~ postgresql ]] ;
    then
      if [[ $DB =~ postgresql- ]] ;
      then
        PG_VER=`echo $DB | sed -e 's/postgresql-//'` ;
        sudo service postgresql stop ;
        sudo apt-get -y -qq --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common ;
        sudo rm -rf /var/lib/postgresql ;
        sudo sh -c "echo deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main ${PG_VER} >> /etc/apt/sources.list.d/pgdg.list" ;
        wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - ;
        sudo apt-get update -qq ;
        sudo apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::="--force-confnew" install postgresql-${PG_VER} postgresql-contrib-${PG_VER} postgresql-server-dev-${PG_VER} ;
        echo "local all all trust" | sudo tee /etc/postgresql/${PG_VER}/main/pg_hba.conf ;
        echo "host all all 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/${PG_VER}/main/pg_hba.conf ;
        echo "host all all ::1/128 trust" | sudo tee -a /etc/postgresql/${PG_VER}/main/pg_hba.conf ;
        sudo service postgresql restart ;
      fi ;
      psql --version ;
      psql -c "SHOW SERVER_VERSION" -U postgres ;
      psql -c "SHOW SERVER_ENCODING" -U postgres ;
      psql -c "SHOW DateStyle" -U postgres ;
    fi
  - sudo sh -x test/travis/install-openldap.sh
script:
  - export DATABASE_ADAPTER=${DB}
  - "SCMS=bazaar,cvs,subversion,git,mercurial,filesystem"
  - "export SCMS"
  - "git --version"
  - "bundle install"
  - "RUN_ON_NOT_OFFICIAL='' RUBY_VER=1.9 BRANCH=trunk bundle exec rake config/database.yml"
  - "bundle install"
  - "bundle exec rake ci:setup"
  - phantomjs --webdriver 4444 &
  - JRUBY_OPTS='-J-Xmx1024m -J-XX:MaxPermSize=1024m' bundle exec rake test:${SUITE}
notifications:
  email: false