-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (78 loc) · 2.97 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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 }}