Skip to content

Commit ca033ce

Browse files
author
Ko Nagase
committed
Supporting Redmine 6.0 (without SVG icon) and drop Redmine <= 5.0 support
Fix CI error
1 parent 1b2da0b commit ca033ce

File tree

3 files changed

+17
-117
lines changed

3 files changed

+17
-117
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -17,115 +17,46 @@ on:
1717
jobs:
1818
test:
1919
name: redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} db:${{ matrix.db }}
20-
runs-on: ubuntu-22.04
21-
22-
container:
23-
image: ruby:${{ matrix.ruby_version }}-bullseye
20+
runs-on: ubuntu-24.04
2421

2522
strategy:
2623
fail-fast: false
2724
matrix:
28-
redmine_version: [4.2-stable, 5.0-stable, 5.1-stable, master]
29-
ruby_version: ['2.7', '3.0', '3.1', '3.2']
30-
db: [postgres, sqlite]
31-
# # System test takes 2~3 times longer, so limit to specific matrix combinations
32-
# # See: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
33-
# include:
34-
# - system_test: true
35-
# redmine_version: 5.1-stable
36-
# ruby_version: '3.2'
37-
# db: postgres
25+
redmine_version: [5.1-stable, 6.0-stable, master]
26+
ruby_version: ['3.1', '3.2', '3.3']
27+
db: ['postgres:14', 'sqlite3']
3828
exclude:
39-
- redmine_version: 4.2-stable
40-
ruby_version: '3.0'
41-
- redmine_version: 4.2-stable
42-
ruby_version: '3.1'
43-
- redmine_version: 4.2-stable
44-
ruby_version: '3.2'
45-
- redmine_version: 5.0-stable
46-
ruby_version: '3.2'
4729
- redmine_version: master
48-
ruby_version: '2.7'
49-
50-
services:
51-
postgres:
52-
image: postgres:10 # min
53-
# image: postgres:15 # latest
54-
env:
55-
POSTGRES_USER: postgres
56-
POSTGRES_PASSWORD: postgres
57-
ports:
58-
- 5432:5432
59-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
30+
ruby_version: '3.1'
6031

6132
steps:
62-
- name: Checkout Redmine
63-
uses: actions/checkout@v4
33+
- name: Setup Redmine
34+
uses: hidakatsuya/action-setup-redmine@v2
6435
with:
6536
repository: redmine/redmine
66-
ref: ${{ matrix.redmine_version }}
37+
version: ${{ matrix.redmine_version }}
38+
ruby-version: ${{ matrix.ruby_version }}
39+
database: ${{ matrix.db }}
6740
path: redmine
6841

6942
- name: Checkout Plugin
7043
uses: actions/checkout@v4
7144
with:
7245
path: redmine/plugins/${{ env.PLUGIN_NAME }}
7346

74-
- name: Update package archives
75-
run: apt-get update --yes --quiet
76-
77-
- name: Install package dependencies
78-
run: |
79-
if [ ${{ matrix.db }} = "postgres" ]; then
80-
apt-get install --yes --quiet postgresql-client
81-
fi
82-
# For system test
83-
if [ ${{ matrix.system_test }} = "true" ]; then
84-
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
85-
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
86-
apt-get -y update
87-
apt-get install -y google-chrome-stable
88-
fi
89-
90-
- name: Prepare Redmine source
91-
working-directory: redmine
92-
run: |
93-
if [ ${{ matrix.db }} = "postgres" ]; then
94-
cat <<EOF > config/database.yml
95-
test:
96-
adapter: postgresql
97-
database: redmine
98-
host: postgres
99-
username: postgres
100-
password: postgres
101-
encoding: utf8
102-
EOF
103-
fi
104-
if [ ${{ matrix.db }} = "sqlite" ]; then
105-
cat <<EOF > config/database.yml
106-
test:
107-
adapter: sqlite3
108-
database: db/redmine.sqlite3
109-
EOF
110-
fi
111-
11247
- name: Install Ruby dependencies
11348
working-directory: redmine
11449
run: |
11550
bundle config set --local without 'development'
11651
bundle install --jobs=4 --retry=3
11752
11853
- name: Run Redmine rake tasks
119-
env:
120-
RAILS_ENV: test
12154
working-directory: redmine
12255
run: |
12356
bundle exec rake generate_secret_token
12457
bundle exec rake db:create db:migrate redmine:plugins:migrate
12558
12659
- name: Zeitwerk check
127-
env:
128-
RAILS_ENV: test
12960
working-directory: redmine
13061
run: |
13162
if grep -q zeitwerk config/application.rb ; then
@@ -134,36 +65,11 @@ jobs:
13465
shell: bash
13566

13667
- name: Run plugin tests
137-
env:
138-
RAILS_ENV: test
139-
# For system test in plugin
140-
GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
14168
working-directory: redmine
14269
run: |
14370
bundle exec rake redmine:plugins:test:units NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
144-
bundle exec rake redmine:plugins:test:functionals NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
14571
bundle exec rake redmine:plugins:test:integration NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
146-
if [ ${{ matrix.system_test }} = "true" ]; then
147-
bundle exec rake redmine:plugins:test:system NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
148-
fi
149-
150-
# - name: Run core tests
151-
# env:
152-
# RAILS_ENV: test
153-
# PARALLEL_WORKERS: 1
154-
# working-directory: redmine
155-
# run: bundle exec rake test
156-
157-
# - name: Run core system tests
158-
# if: matrix.system_test == true
159-
# env:
160-
# RAILS_ENV: test
161-
# GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
162-
# working-directory: redmine
163-
# run: bundle exec rake test:system
16472
16573
- name: Run uninstall test
166-
env:
167-
RAILS_ENV: test
16874
working-directory: redmine
16975
run: bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This Redmine plugin enables supply management for issues.
44

55
## Requirements
66

7-
- Redmine >= 4.2.0
7+
- Redmine >= 5.1.0
88

99
## Installation
1010

@@ -39,6 +39,7 @@ The GTT Project appreciates any [contributions](https://github.com/gtt-project/.
3939

4040
## Version History
4141

42+
- 4.0.0 Supporting Redmine 6.0 (without SVG icon) and drop Redmine <= 5.0 support
4243
- 3.0.0 Support Redmine 5.0 and drop Redmine <= 4.1 support
4344
- 2.1.0 Publish on GitHub
4445

init.rb

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled?
2-
Rails.application.config.after_initialize do
3-
RedmineSupply.setup
4-
RedmineResourceManager.setup
5-
end
6-
else
7-
Rails.configuration.to_prepare do
8-
RedmineSupply.setup
9-
RedmineResourceManager.setup
10-
end
1+
Rails.application.config.after_initialize do
2+
RedmineSupply.setup
3+
RedmineResourceManager.setup
114
end
125

136
Redmine::Plugin.register :redmine_supply do
@@ -16,9 +9,9 @@
169
author_url 'https://github.com/georepublic'
1710
url 'https://github.com/gtt-project/redmine_supply'
1811
description 'Adds configurable supply and resource items to issues'
19-
version '3.0.0'
12+
version '4.0.0'
2013

21-
requires_redmine version_or_higher: '4.2.0'
14+
requires_redmine version_or_higher: '5.1.0'
2215

2316
settings default: {
2417
"unit_cf" => "Unit"

0 commit comments

Comments
 (0)