additionals/.travis.yml
2020-07-30 14:41:44 +02:00

44 lines
1.5 KiB
YAML

language: ruby
os: linux
dist: xenial
rvm:
- 2.6.6
- 2.5.8
- 2.4.10
services:
- mysql
- postgresql
env:
- REDMINE_VER=4.1-stable DB=postgresql
- REDMINE_VER=master DB=postgresql
- REDMINE_VER=4.1-stable DB=mysql
- REDMINE_VER=master DB=mysql
before_install:
- export PLUGIN_NAME=additionals
- export REDMINE_GIT_REPO=git://github.com/redmine/redmine.git
- export REDMINE_PATH=$HOME/redmine
- export BUNDLE_GEMFILE=$REDMINE_PATH/Gemfile
- export RAILS_ENV=test
- git clone $REDMINE_GIT_REPO $REDMINE_PATH
- cd $REDMINE_PATH
- if [[ "$REDMINE_VER" != "master" ]]; then git checkout -b $REDMINE_VER origin/$REDMINE_VER; fi
- sed -i '/rubocop/d' $REDMINE_PATH/Gemfile
- rm -f $REDMINE_PATH/.rubocop*
- cp $TRAVIS_BUILD_DIR/test/support/Gemfile.local $REDMINE_PATH
- ln -s $TRAVIS_BUILD_DIR $REDMINE_PATH/plugins/$PLUGIN_NAME
- cp $TRAVIS_BUILD_DIR/test/support/additional_environment.rb $REDMINE_PATH/config/
- cp $TRAVIS_BUILD_DIR/test/support/database-$DB-travis.yml $REDMINE_PATH/config/database.yml
before_script:
- bundle exec rake db:create db:migrate redmine:plugins:migrate
script:
- if [[ "$REDMINE_VER" != "master" ]] && [[ "$DB" == "postgresql" ]]; then brakeman plugins/$PLUGIN_NAME; fi
- if [[ "$REDMINE_VER" != "master" ]] && [[ "$DB" == "postgresql" ]]; then rubocop plugins/$PLUGIN_NAME; fi
- bundle exec rake redmine:plugins:test NAME=$PLUGIN_NAME RUBYOPT="-W0"
- bundle exec rake redmine:plugins:migrate NAME=$PLUGIN_NAME VERSION=0