-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (96 loc) · 3.47 KB
/
test.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Test
env:
PLUGIN_NAME: ${{ github.event.repository.name }}
on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next
workflow_dispatch:
jobs:
test:
name: redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} db:${{ matrix.db }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
redmine_version: [4.2-stable, 5.0-stable, 5.1-stable, master]
ruby_version: ['2.7', '3.0', '3.1', '3.2']
db: ['mysql:5.7', 'postgres:10', 'sqlite3']
# System test takes 2~3 times longer, so limit to specific matrix combinations
# See: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
include:
- system_test: true
redmine_version: 5.1-stable
ruby_version: '3.2'
db: 'mysql:5.7'
exclude:
- redmine_version: 4.2-stable
ruby_version: '3.0'
- redmine_version: 4.2-stable
ruby_version: '3.1'
- redmine_version: 4.2-stable
ruby_version: '3.2'
- redmine_version: 5.0-stable
ruby_version: '3.2'
- redmine_version: master
ruby_version: '2.7'
steps:
- name: Setup Redmine
uses: hidakatsuya/action-setup-redmine@v1
with:
repository: redmine/redmine
version: ${{ matrix.redmine_version }}
ruby-version: ${{ matrix.ruby_version }}
database: ${{ matrix.db }}
path: redmine
- name: Checkout Plugin
uses: actions/checkout@v4
with:
path: redmine/plugins/${{ env.PLUGIN_NAME }}
- name: Install Ruby dependencies
working-directory: redmine
run: |
bundle config set --local without 'development'
bundle install --jobs=4 --retry=3
- name: Run Redmine rake tasks
working-directory: redmine
run: |
bundle exec rake generate_secret_token
bundle exec rake db:create db:migrate redmine:plugins:migrate
- name: Zeitwerk check
working-directory: redmine
run: |
if grep -q zeitwerk config/application.rb ; then
bundle exec rake zeitwerk:check
fi
shell: bash
- name: Run plugin tests
working-directory: redmine
run: |
bundle exec rake redmine:plugins:test:units NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
bundle exec rake redmine:plugins:test:functionals NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
bundle exec rake redmine:plugins:test:integration NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
if [ ${{ matrix.system_test }} = "true" ]; then
bundle exec rake redmine:plugins:test:system NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
fi
# - name: Run core tests
# env:
# RAILS_ENV: test
# PARALLEL_WORKERS: 1
# working-directory: redmine
# run: bundle exec rake test
# - name: Run core system tests
# if: matrix.system_test == true
# env:
# RAILS_ENV: test
# GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
# working-directory: redmine
# run: bundle exec rake test:system
- name: Run uninstall test
working-directory: redmine
run: bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0