mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
travis -> GH actions
This commit is contained in:
32
.github/workflows/redmine.yml
vendored
Normal file
32
.github/workflows/redmine.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Test with Redmine
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
redmine:
|
||||
- '5.0'
|
||||
- '5.1'
|
||||
ruby:
|
||||
- '3.0'
|
||||
- '3.1'
|
||||
database:
|
||||
- postgresql
|
||||
- mysql
|
||||
steps:
|
||||
- uses: eXolnet/action-redmine-plugin@v1
|
||||
with:
|
||||
plugin_name: stopwatch
|
||||
redmine_version: ${{ matrix.redmine }}
|
||||
ruby_version: ${{ matrix.ruby }}
|
||||
database: ${{ matrix.database }}
|
||||
|
||||
37
.travis.yml
37
.travis.yml
@@ -1,37 +0,0 @@
|
||||
sudo: false
|
||||
language: ruby
|
||||
rvm:
|
||||
- 2.6.8
|
||||
- 2.7.4
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
addons:
|
||||
postgresql: "9.6"
|
||||
|
||||
env:
|
||||
- REDMINE_VER=4.1-stable
|
||||
- REDMINE_VER=4.2-stable
|
||||
- REDMINE_VER=master
|
||||
|
||||
jobs:
|
||||
exclude:
|
||||
- rvm: 2.7.4
|
||||
env: REDMINE_VER=4.1-stable
|
||||
|
||||
install: "echo skip bundle install"
|
||||
|
||||
before_script:
|
||||
- psql -c 'create database travis_ci_test;' -U postgres
|
||||
|
||||
script:
|
||||
- export TESTSPACE=`pwd`/testspace
|
||||
- export NAME_OF_PLUGIN=stopwatch
|
||||
- export PATH_TO_PLUGIN=`pwd`
|
||||
- export PATH_TO_REDMINE=$TESTSPACE/redmine
|
||||
- mkdir $TESTSPACE
|
||||
- cp test/support/* $TESTSPACE/
|
||||
- bash -x ./travis.sh
|
||||
|
||||
77
travis.sh
77
travis.sh
@@ -1,77 +0,0 @@
|
||||
#/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ ! "$TESTSPACE" = /* ]] ||
|
||||
[[ ! "$PATH_TO_REDMINE" = /* ]] ||
|
||||
[[ ! "$REDMINE_VER" = * ]] ||
|
||||
[[ ! "$NAME_OF_PLUGIN" = * ]] ||
|
||||
[[ ! "$PATH_TO_PLUGIN" = /* ]];
|
||||
then
|
||||
echo "You should set"\
|
||||
" TESTSPACE, PATH_TO_REDMINE, REDMINE_VER"\
|
||||
" NAME_OF_PLUGIN, PATH_TO_PLUGIN"\
|
||||
" environment variables"
|
||||
echo "You set:"\
|
||||
"$TESTSPACE"\
|
||||
"$PATH_TO_REDMINE"\
|
||||
"$REDMINE_VER"\
|
||||
"$NAME_OF_PLUGIN"\
|
||||
"$PATH_TO_PLUGIN"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
export RAILS_ENV=test
|
||||
|
||||
export REDMINE_GIT_REPO=git://github.com/redmine/redmine.git
|
||||
export REDMINE_GIT_TAG=$REDMINE_VER
|
||||
export BUNDLE_GEMFILE=$PATH_TO_REDMINE/Gemfile
|
||||
|
||||
# checkout redmine
|
||||
git clone $REDMINE_GIT_REPO $PATH_TO_REDMINE
|
||||
cd $PATH_TO_REDMINE
|
||||
if [ ! "$REDMINE_GIT_TAG" = "master" ];
|
||||
then
|
||||
git checkout -b $REDMINE_GIT_TAG origin/$REDMINE_GIT_TAG
|
||||
fi
|
||||
|
||||
# copy plugin to Redmine plugins dir.
|
||||
rm -fr plugins/$NAME_OF_PLUGIN
|
||||
mkdir plugins/$NAME_OF_PLUGIN
|
||||
rsync -a --exclude=testspace $PATH_TO_PLUGIN/* plugins/$NAME_OF_PLUGIN/
|
||||
|
||||
mv $TESTSPACE/database.yml.travis config/database.yml
|
||||
mv $TESTSPACE/additional_environment.rb config/
|
||||
|
||||
cat << EOF > lib/tasks/00_nowarnings.rake
|
||||
require 'rake/testtask'
|
||||
|
||||
module NoWarnings
|
||||
def define(*_)
|
||||
self.warning = false
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
Rake::TestTask.prepend NoWarnings
|
||||
EOF
|
||||
|
||||
# install gems
|
||||
bundle install
|
||||
|
||||
# run redmine database migrations
|
||||
bundle exec rake db:migrate
|
||||
|
||||
# run plugin database migrations
|
||||
bundle exec rake redmine:plugins:migrate
|
||||
|
||||
# install redmine database
|
||||
#bundle exec rake redmine:load_default_data REDMINE_LANG=en
|
||||
|
||||
bundle exec rake db:structure:dump
|
||||
|
||||
# run tests
|
||||
# bundle exec rake TEST=test/unit/role_test.rb
|
||||
bundle exec rails test plugins/$NAME_OF_PLUGIN/test/**/*.rb
|
||||
|
||||
|
||||
Reference in New Issue
Block a user