-
Notifications
You must be signed in to change notification settings - Fork 6
158 lines (140 loc) · 4.96 KB
/
Copy pathtest-postgis.yml
File metadata and controls
158 lines (140 loc) · 4.96 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Test with PostGIS
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 }} postgis:${{ matrix.db_version }}
runs-on: ubuntu-22.04
container:
image: ruby:${{ matrix.ruby_version }}-bullseye
strategy:
fail-fast: false
matrix:
# Test each Redmine version against the Ruby versions it supports
# (https://redmine.jp/tech_note/supported-rubies/), limited to Rubies
# still in upstream support (3.1 EOL 2025-03, 3.2 EOL 2026-03):
# 6.0-stable -> 3.3
# 6.1-stable -> 3.3, 3.4
# (5.1-stable dropped: no currently supported Ruby.)
redmine_version: [6.0-stable, 6.1-stable]
ruby_version: ['3.3', '3.4']
# postgis/postgis tags spanning PG 15/17/18 and PostGIS 3.4/3.5/3.6
# (floor -> ceiling; ceiling matches the PG18 + PostGIS 3.6 runtime).
db_version: [15-3.4, 17-3.5, 18-3.6]
include:
- system_test: true
redmine_version: 6.1-stable
ruby_version: '3.4'
exclude:
# Redmine 6.0 supports Ruby up to 3.3 only.
- redmine_version: 6.0-stable
ruby_version: '3.4'
services:
postgres:
image: postgis/postgis:${{ matrix.db_version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout Redmine
uses: actions/checkout@v4
with:
repository: redmine/redmine
ref: ${{ matrix.redmine_version }}
path: redmine
- name: Checkout Plugin
uses: actions/checkout@v4
with:
path: redmine/plugins/${{ env.PLUGIN_NAME }}
- name: Update package archives
run: apt-get update --yes --quiet
- name: Install package dependencies
run: |
apt-get install --yes --quiet \
postgresql-client \
gcc libpq-dev make patch libgeos-dev curl
# For system test
if [ ${{ matrix.system_test }} = "true" ]; then
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
apt-get -y update
apt-get install -y google-chrome-stable
fi
- name: Install Node and pnpm
run: |
curl -sL https://deb.nodesource.com/setup_22.x | bash -
apt-get install --yes --quiet --no-install-recommends nodejs
# corepack picks the pnpm version pinned in package.json
corepack enable pnpm
- name: Prepare Plugin
working-directory: redmine/plugins/redmine_gtt
env:
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
run: |
pnpm install --frozen-lockfile
pnpm typecheck
pnpm build
- name: Prepare Redmine source
working-directory: redmine
run: |
cat <<EOF > config/database.yml
test:
adapter: postgis
database: redmine
host: postgres
username: postgres
password: postgres
encoding: utf8
EOF
- 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
env:
RAILS_ENV: test
working-directory: redmine
run: |
bundle exec rake generate_secret_token
bundle exec rake db:create db:migrate redmine:plugins:migrate
- name: Zeitwerk check
env:
RAILS_ENV: test
working-directory: redmine
run: |
if grep -q zeitwerk config/application.rb ; then
bundle exec rake zeitwerk:check
fi
shell: bash
- name: Run tests
env:
RAILS_ENV: test
# For system test in plugin
GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
working-directory: redmine
run: |
bundle exec rails test plugins/redmine_gtt/test/unit
bundle exec rails test plugins/redmine_gtt/test/functional
bundle exec rails test plugins/redmine_gtt/test/integration
if [ ${{ matrix.system_test }} = "true" ]; then
bundle exec rails test plugins/redmine_gtt/test/system
fi
- name: Run uninstall test
env:
RAILS_ENV: test
working-directory: redmine
run: bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0