18
18
test :
19
19
name : redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} postgis:${{ matrix.db_version }}
20
20
runs-on : ubuntu-22.04
21
+
21
22
container :
22
23
image : ruby:${{ matrix.ruby_version }}-bullseye
23
24
47
48
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
48
49
49
50
steps :
50
- - name : Checkout repository
51
- uses : actions/checkout@v4
52
-
53
- - name : List scripts directory for debugging
54
- run : ls -l $GITHUB_WORKSPACE/scripts
55
-
56
51
- name : Checkout Redmine
57
52
uses : actions/checkout@v4
58
53
with :
@@ -65,45 +60,97 @@ jobs:
65
60
with :
66
61
path : redmine/plugins/${{ env.PLUGIN_NAME }}
67
62
68
- - name : Setup Environment
69
- run : $GITHUB_WORKSPACE/scripts/setup_environment.sh
63
+ - name : Update package archives
64
+ run : apt-get update --yes --quiet
65
+
66
+ - name : Install package dependencies
67
+ run : |
68
+ apt-get install --yes --quiet \
69
+ postgresql-client \
70
+ gcc libpq-dev make patch libgeos-dev curl
71
+ # For system test
72
+ if [ ${{ matrix.system_test }} = "true" ]; then
73
+ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
74
+ sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
75
+ apt-get -y update
76
+ apt-get install -y google-chrome-stable
77
+ fi
78
+
79
+ - name : Install Node/Yarn packages
80
+ run : |
81
+ curl -sL https://deb.nodesource.com/setup_20.x | bash -
82
+ curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
83
+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
84
+ apt-get update --yes --quiet
85
+ apt-get install --yes --quiet --no-install-recommends nodejs yarn
70
86
71
87
- name : Prepare Plugin
72
- working-directory : redmine/plugins/${{ env.PLUGIN_NAME }}
73
- run : $GITHUB_WORKSPACE/scripts/prepare_plugin.sh
88
+ working-directory : redmine/plugins/redmine_gtt
89
+ run : |
90
+ yarn
91
+ npx webpack
74
92
75
93
- name : Prepare Redmine source
76
94
working-directory : redmine
77
- run : $GITHUB_WORKSPACE/scripts/prepare_redmine.sh
95
+ run : |
96
+ cat <<EOF > config/database.yml
97
+ test:
98
+ adapter: postgis
99
+ database: redmine
100
+ host: postgres
101
+ username: postgres
102
+ password: postgres
103
+ encoding: utf8
104
+ EOF
78
105
79
106
- name : Adjust Gem environment
80
- run : $GITHUB_WORKSPACE/scripts/adjust_gem_env.sh
107
+ run : |
108
+ case "${{ matrix.redmine_version }}" in
109
+ master)
110
+ echo "GEM_ACTIVERECORD_POSTGIS_ADAPTER_VERSION=9.0.1" >> ${GITHUB_ENV}
111
+ ;;
112
+ esac
81
113
82
114
- name : Install Ruby dependencies
83
115
working-directory : redmine
84
- run : $GITHUB_WORKSPACE/scripts/install_ruby_dependencies.sh
116
+ run : |
117
+ bundle config set --local without 'development'
118
+ bundle install --jobs=4 --retry=3
85
119
86
120
- name : Run Redmine rake tasks
87
121
env :
88
122
RAILS_ENV : test
89
123
working-directory : redmine
90
- run : $GITHUB_WORKSPACE/scripts/run_rake_tasks.sh
124
+ run : |
125
+ bundle exec rake generate_secret_token
126
+ bundle exec rake db:create db:migrate redmine:plugins:migrate
91
127
92
128
- name : Zeitwerk check
93
129
env :
94
130
RAILS_ENV : test
95
131
working-directory : redmine
96
- run : $GITHUB_WORKSPACE/scripts/zeitwerk_check.sh
132
+ run : |
133
+ if grep -q zeitwerk config/application.rb ; then
134
+ bundle exec rake zeitwerk:check
135
+ fi
136
+ shell : bash
97
137
98
138
- name : Run tests
99
139
env :
100
140
RAILS_ENV : test
141
+ # For system test in plugin
101
142
GOOGLE_CHROME_OPTS_ARGS : " headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
102
143
working-directory : redmine
103
- run : $GITHUB_WORKSPACE/scripts/run_tests.sh
144
+ run : |
145
+ bundle exec rake redmine:plugins:test:units NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
146
+ bundle exec rake redmine:plugins:test:functionals NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
147
+ bundle exec rake redmine:plugins:test:integration NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
148
+ if [ ${{ matrix.system_test }} = "true" ]; then
149
+ bundle exec rake redmine:plugins:test:system NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
150
+ fi
104
151
105
152
- name : Run uninstall test
106
153
env :
107
154
RAILS_ENV : test
108
155
working-directory : redmine
109
- run : $GITHUB_WORKSPACE/scripts/run_uninstall_test.sh
156
+ run : bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0
0 commit comments