Skip to content

Merge pull request #9 from hidakatsuya/separate-setup-script-for-each… #143

Merge pull request #9 from hidakatsuya/separate-setup-script-for-each…

Merge pull request #9 from hidakatsuya/separate-setup-script-for-each… #143

Workflow file for this run

name: Build
on:
push:
branches:
- main
- dev/**
paths-ignore:
- "*.md"
pull_request:
env:
REDMINE_SRC: redmine-src
jobs:
build:
runs-on: ubuntu-latest
name: ${{ matrix.redmine-repository }} ${{ matrix.redmine-version }} ${{ matrix.redmine-database }}
strategy:
matrix:
include:
- redmine-repository: "redmine/redmine"
redmine-version: "4.2-stable"
redmine-database: "sqlite3"
ruby-version: "2.7"
expected-about-db-adapter: "SQLite"
expected-about-redmine-version: '4\.2\.[0-9]\+\.stable'
- redmine-repository: "redmine/redmine"
redmine-version: "5.1-stable"
redmine-database: "mysql:8.1"
ruby-version: "3.2"
expected-about-db-adapter: "Mysql2"
expected-about-redmine-version: '5\.1\.[0-9]\+\.stable'
- redmine-repository: "redmica/redmica"
redmine-version: "stable-2.0"
redmine-database: "postgres:10"
ruby-version: "2.7"
expected-about-db-adapter: "PostgreSQL"
expected-about-redmine-version: '2\.0\.[0-9]\+\.stable'
- redmine-repository: "redmica/redmica"
redmine-version: "stable-2.4"
redmine-database: "postgres:14"
ruby-version: "3.2"
expected-about-db-adapter: "PostgreSQL"
expected-about-redmine-version: '2\.4\.[0-9]\+\.stable'
steps:
- uses: actions/checkout@v4
- uses: ./
with:
path: ${{ env.REDMINE_SRC }}
repository: ${{ matrix.redmine-repository }}
version: ${{ matrix.redmine-version }}
database: ${{ matrix.redmine-database }}
ruby-version: ${{ matrix.ruby-version }}
- name: Define Redmine version environment variables
run: ./scripts/set-version-envs.sh
env:
REDMINE_DIR: ${{ env.REDMINE_SRC }}
- name: Install a plugin for testing
run: |
cp -R ../.github/hello_world plugins/
bin/rails redmine:plugins:migrate
working-directory: ${{ env.REDMINE_SRC }}
- name: Test Redmine environment
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 }}
- name: Run unit test
run: bin/rails test test/unit/news_test.rb
working-directory: ${{ env.REDMINE_SRC }}
- name: Run system test if Redmine >= 5.0
if: ${{ env.REDMINE_VERSION_MAJOR >= 5 }}
run: bin/rails test test/system/my_page_test.rb
working-directory: ${{ env.REDMINE_SRC }}
- name: Run plugin test
run: bin/rails redmine:plugins:test
working-directory: ${{ env.REDMINE_SRC }}