Skip to content

upgrade redmine/redmica and ruby versions in redmine_plugin.yml #111

upgrade redmine/redmica and ruby versions in redmine_plugin.yml

upgrade redmine/redmica and ruby versions in redmine_plugin.yml #111

name: Redmine Plugin
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
mat_env:
- '3.3 redmica/[email protected]'
- '3.3 redmica/[email protected]'
- '3.2 redmica/[email protected]'
- '3.2 redmica/[email protected]'
- '3.1 redmica/[email protected]'
- '3.0 redmica/[email protected]'
- '2.7 redmica/[email protected]'
- '3.3 redmine/[email protected]'
- '3.2 redmine/[email protected]'
- '3.1 redmine/[email protected]'
- '3.0 redmine/[email protected]'
- '2.7 redmine/[email protected]'
- '2.6 redmine/[email protected]'
experimental: [false]
include:
- mat_env: '3.3 redmica/redmica@master'
experimental: true
steps:
- run: |
echo PLUGIN_NAME=$PLUGIN_NAME >> $GITHUB_ENV
echo RUBY_VERSION=$(echo $MAT_ENV | cut -d' ' -f1) >> $GITHUB_ENV
echo REDMINE_REPOSITORY=$(echo $MAT_ENV | cut -d' ' -f2 | cut -d@ -f1) >> $GITHUB_ENV
echo REDMINE_REF=$(echo $MAT_ENV | cut -d' ' -f2 | cut -d@ -f2) >> $GITHUB_ENV
env:
PLUGIN_NAME: redmine_hearts
MAT_ENV: ${{ matrix.mat_env }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Checkout
uses: actions/checkout@v4
with:
path: ./${{ env.PLUGIN_NAME }}
- name: Set up Redmine
uses: actions/checkout@v4
with:
repository: ${{ env.REDMINE_REPOSITORY }}
ref: ${{ env.REDMINE_REF }}
path: ./redmine
- name: Copy the plugin files to plugin directory
run: cp -pr ./${{ env.PLUGIN_NAME }} ./redmine/plugins/${{ env.PLUGIN_NAME }}
- name: Create redmine/config/database.yml
uses: DamianReeves/[email protected]
with:
path: ./redmine/config/database.yml
contents: |
test:
adapter: sqlite3
database: db/redmine_test.db
- uses: actions/cache@v4
with:
path: ./redmine/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('./redmine/**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: "'LoadError: cannot load such file -- blankslate' Issue HACK ref. https://www.redmine.org/issues/40802#note-11"
uses: DamianReeves/[email protected]
with:
path: ./redmine/Gemfile.local
contents: |
gem 'builder', '~> 3.2.4'
if: contains(fromJSON('["3.2 redmica/[email protected]", "3.2 redmica/[email protected]", "3.1 redmica/[email protected]", "3.0 redmica/[email protected]", "2.7 redmica/[email protected]", "2.6 redmine/[email protected]", "2.6 redmine/[email protected]", "2.5 redmine/[email protected]", "2.6 redmine/[email protected]", "2.7 redmine/[email protected]"]'), matrix.mat_env)
- name: Before script
run: |
bundle config --local path ${BUNDLE_PATH:-vendor/bundle}
bundle install
mv plugins plugins_bak
# Initialize redmine
bundle exec rake generate_secret_token
bundle exec rake db:migrate
bundle exec rake redmine:load_default_data
mv plugins_bak plugins
# Execute plugin's migration
bundle exec rake redmine:plugins NAME=${{ env.PLUGIN_NAME }}
working-directory: ./redmine
env:
REDMINE_LANG: en
RAILS_ENV: test
# HACK sometimes fails login error, so retry 10 times
- name: Execute test
run: |
#!/bin/sh
for i in `seq 0 9`; do
# Execute plugin's test
bundle exec rake redmine:plugins:test NAME=${{ env.PLUGIN_NAME }}
retval=$?
if [ "$retval" -eq 0 ]; then
break
fi
echo "${i}-th test failed; Retry test..."
done
exit $retval
shell: bash {0}
working-directory: ./redmine
env:
REDMINE_LANG: en
RAILS_ENV: test