diff --git a/.github/hello_world/README.rdoc b/.github/hello_world/README.rdoc new file mode 100644 index 0000000..4eead3c --- /dev/null +++ b/.github/hello_world/README.rdoc @@ -0,0 +1,3 @@ += hello_world + +Description goes here diff --git a/.github/hello_world/app/models/hello.rb b/.github/hello_world/app/models/hello.rb new file mode 100644 index 0000000..1fd50ab --- /dev/null +++ b/.github/hello_world/app/models/hello.rb @@ -0,0 +1,2 @@ +class Hello < ActiveRecord::Base +end diff --git a/.github/hello_world/config/locales/en.yml b/.github/hello_world/config/locales/en.yml new file mode 100644 index 0000000..642b07f --- /dev/null +++ b/.github/hello_world/config/locales/en.yml @@ -0,0 +1,3 @@ +# English strings go here for Rails i18n +en: + # my_label: "My label" diff --git a/.github/hello_world/config/routes.rb b/.github/hello_world/config/routes.rb new file mode 100644 index 0000000..1803173 --- /dev/null +++ b/.github/hello_world/config/routes.rb @@ -0,0 +1,2 @@ +# Plugin's routes +# See: http://guides.rubyonrails.org/routing.html diff --git a/.github/hello_world/db/migrate/20240518044930_create_hellos.rb b/.github/hello_world/db/migrate/20240518044930_create_hellos.rb new file mode 100644 index 0000000..2e436ed --- /dev/null +++ b/.github/hello_world/db/migrate/20240518044930_create_hellos.rb @@ -0,0 +1,7 @@ +class CreateHellos < ActiveRecord::Migration[6.1] + def change + create_table :hellos do |t| + t.string :world + end + end +end diff --git a/.github/hello_world/init.rb b/.github/hello_world/init.rb new file mode 100644 index 0000000..c31673d --- /dev/null +++ b/.github/hello_world/init.rb @@ -0,0 +1,8 @@ +Redmine::Plugin.register :hello_world do + name 'Hello World' + author 'Author name' + description 'This is a plugin for Redmine' + version '0.0.1' + url 'http://example.com/path/to/plugin' + author_url 'http://example.com/about' +end diff --git a/.github/hello_world/test/test_helper.rb b/.github/hello_world/test/test_helper.rb new file mode 100644 index 0000000..55b016f --- /dev/null +++ b/.github/hello_world/test/test_helper.rb @@ -0,0 +1,2 @@ +# Load the Redmine helper +require_relative '../../../test/test_helper' diff --git a/.github/hello_world/test/unit/hello_test.rb b/.github/hello_world/test/unit/hello_test.rb new file mode 100644 index 0000000..fdf800d --- /dev/null +++ b/.github/hello_world/test/unit/hello_test.rb @@ -0,0 +1,8 @@ +require_relative '../test_helper' + +class HelloTest < ActiveSupport::TestCase + def test_world + Hello.create world: "Redmine" + assert_equal "Redmine", Hello.first.world + end +end diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a92ed3d..f27da37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,14 +53,22 @@ jobs: database: ${{ matrix.redmine-database }} ruby-version: ${{ matrix.ruby-version }} + - name: Install a plugin for testing + run: | + cp -R ../.github/hello_world plugins/ + bin/rails redmine:plugins:migrate + working-directory: ${{ env.REDMINE_SRC }} + - run: | about=$(bin/rails r "require 'redmine/version'; puts Redmine::Info.environment") echo "$about" echo "$about" | grep "${{ matrix.expected-about-db-adapter }}" echo "$about" | grep "${{ matrix.expected-about-redmine-version }}" + echo "$about" | grep "hello_world" working-directory: ${{ env.REDMINE_SRC }} - run: | bin/rails test test/unit/news_test.rb bin/rails test test/system/my_page_test.rb + bin/rails redmine:plugins:test working-directory: ${{ env.REDMINE_SRC }}