Skip to content

Commit 1b0656c

Browse files
committed
Revert use of scripts
Signed-off-by: Daniel Kastl <[email protected]>
1 parent 2263824 commit 1b0656c

10 files changed

+64
-81
lines changed

.github/workflows/test-postgis.yml

Lines changed: 64 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
test:
1919
name: redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} postgis:${{ matrix.db_version }}
2020
runs-on: ubuntu-22.04
21+
2122
container:
2223
image: ruby:${{ matrix.ruby_version }}-bullseye
2324

@@ -47,12 +48,6 @@ jobs:
4748
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
4849

4950
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-
5651
- name: Checkout Redmine
5752
uses: actions/checkout@v4
5853
with:
@@ -65,45 +60,97 @@ jobs:
6560
with:
6661
path: redmine/plugins/${{ env.PLUGIN_NAME }}
6762

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
7086
7187
- 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
7492
7593
- name: Prepare Redmine source
7694
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
78105
79106
- 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
81113
82114
- name: Install Ruby dependencies
83115
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
85119
86120
- name: Run Redmine rake tasks
87121
env:
88122
RAILS_ENV: test
89123
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
91127
92128
- name: Zeitwerk check
93129
env:
94130
RAILS_ENV: test
95131
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
97137

98138
- name: Run tests
99139
env:
100140
RAILS_ENV: test
141+
# For system test in plugin
101142
GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
102143
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
104151
105152
- name: Run uninstall test
106153
env:
107154
RAILS_ENV: test
108155
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

scripts/adjust_gem_env.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

scripts/install_ruby_dependencies.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/prepare_plugin.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/prepare_redmine.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

scripts/run_rake_tasks.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/run_tests.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/run_uninstall_test.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/setup_environment.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/zeitwerk_check.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)