Skip to content

Commit

Permalink
Revert use of scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kastl <[email protected]>
  • Loading branch information
dkastl committed Jun 7, 2024
1 parent 2263824 commit 1b0656c
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 81 deletions.
81 changes: 64 additions & 17 deletions .github/workflows/test-postgis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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

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

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: List scripts directory for debugging
run: ls -l $GITHUB_WORKSPACE/scripts

- name: Checkout Redmine
uses: actions/checkout@v4
with:
Expand All @@ -65,45 +60,97 @@ jobs:
with:
path: redmine/plugins/${{ env.PLUGIN_NAME }}

- name: Setup Environment
run: $GITHUB_WORKSPACE/scripts/setup_environment.sh
- 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/Yarn packages
run: |
curl -sL https://deb.nodesource.com/setup_20.x | bash -
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update --yes --quiet
apt-get install --yes --quiet --no-install-recommends nodejs yarn
- name: Prepare Plugin
working-directory: redmine/plugins/${{ env.PLUGIN_NAME }}
run: $GITHUB_WORKSPACE/scripts/prepare_plugin.sh
working-directory: redmine/plugins/redmine_gtt
run: |
yarn
npx webpack
- name: Prepare Redmine source
working-directory: redmine
run: $GITHUB_WORKSPACE/scripts/prepare_redmine.sh
run: |
cat <<EOF > config/database.yml
test:
adapter: postgis
database: redmine
host: postgres
username: postgres
password: postgres
encoding: utf8
EOF
- name: Adjust Gem environment
run: $GITHUB_WORKSPACE/scripts/adjust_gem_env.sh
run: |
case "${{ matrix.redmine_version }}" in
master)
echo "GEM_ACTIVERECORD_POSTGIS_ADAPTER_VERSION=9.0.1" >> ${GITHUB_ENV}
;;
esac
- name: Install Ruby dependencies
working-directory: redmine
run: $GITHUB_WORKSPACE/scripts/install_ruby_dependencies.sh
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: $GITHUB_WORKSPACE/scripts/run_rake_tasks.sh
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: $GITHUB_WORKSPACE/scripts/zeitwerk_check.sh
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: $GITHUB_WORKSPACE/scripts/run_tests.sh
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 uninstall test
env:
RAILS_ENV: test
working-directory: redmine
run: $GITHUB_WORKSPACE/scripts/run_uninstall_test.sh
run: bundle exec rake redmine:plugins:migrate NAME=${{ env.PLUGIN_NAME }} VERSION=0
7 changes: 0 additions & 7 deletions scripts/adjust_gem_env.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/install_ruby_dependencies.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/prepare_plugin.sh

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/prepare_redmine.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/run_rake_tasks.sh

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/run_tests.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/run_uninstall_test.sh

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/setup_environment.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/zeitwerk_check.sh

This file was deleted.

0 comments on commit 1b0656c

Please sign in to comment.