CI: add Redmine 7.0 / Ruby 4.0 coverage, slim the test matrix #546
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test with PostGIS | |
| env: | |
| PLUGIN_NAME: ${{ github.event.repository.name }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| pull_request: | |
| branches: | |
| - main | |
| - next | |
| workflow_dispatch: | |
| jobs: | |
| frontend: | |
| name: Frontend (typecheck + unit tests) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Plugin | |
| uses: actions/checkout@v6 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| env: | |
| COREPACK_ENABLE_DOWNLOAD_PROMPT: "0" | |
| run: | | |
| corepack enable pnpm | |
| pnpm install --frozen-lockfile | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| - name: Unit tests | |
| run: pnpm test | |
| test: | |
| name: redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} postgis:${{ matrix.db_version }} | |
| runs-on: ubuntu-latest | |
| env: | |
| # Redmine 7 (Rails 8.1) needs the 8.1-compatible geo gem stack; older | |
| # Redmine stays on the Gemfile defaults. The Gemfile reads these env vars. | |
| GEM_RGEO_VERSION: ${{ matrix.rgeo || '3.0.1' }} | |
| GEM_RGEO_ACTIVERECORD_VERSION: ${{ matrix.rgeo_ar || '8.0.0' }} | |
| GEM_ACTIVERECORD_POSTGIS_ADAPTER_VERSION: ${{ matrix.postgis_adapter || '10.0.0' }} | |
| strategy: | |
| fail-fast: false | |
| # Curated matrix instead of a full redmine x ruby x postgis cross-product, | |
| # split into two concerns so coverage stays broad but the job count small: | |
| # * compat - each supported Redmine/Ruby pair once, on the ceiling DB. | |
| # Supported Rubies per | |
| # https://redmine.jp/tech_note/supported-rubies/ (Rubies | |
| # still in upstream support): 6.0 -> 3.3, 6.1 -> 3.3/3.4, | |
| # 7.0 -> 3.4/4.0. | |
| # * database - the PostGIS variants (PG 15/17/18, PostGIS 3.4/3.5/3.6), | |
| # pinned to the known-stable 6.1/3.4 pair to isolate DB | |
| # issues from Redmine-7/Ruby-4 newness. | |
| # Redmine 7 (Rails 8.1) needs the 8.1 geo gem stack, driven per-row via the | |
| # GEM_* env vars below (adapter 11.1, rgeo-activerecord 8.1, rgeo 3.1 for | |
| # Ruby 4.0); 6.x stays on the Gemfile defaults. | |
| matrix: | |
| include: | |
| # compat: each supported Redmine/Ruby pair once, on the 18-3.6 ceiling. | |
| # The 6.1/3.4 pair is exercised by the database rows below. | |
| - { redmine_version: 6.0-stable, ruby_version: '3.3', db_version: 18-3.6 } | |
| - { redmine_version: 6.1-stable, ruby_version: '3.3', db_version: 18-3.6 } | |
| - { redmine_version: 7.0-stable, ruby_version: '3.4', db_version: 18-3.6, rgeo_ar: '8.1.0', postgis_adapter: '11.1.0' } | |
| - { redmine_version: 7.0-stable, ruby_version: '4.0', db_version: 18-3.6, rgeo: '3.1.0', rgeo_ar: '8.1.0', postgis_adapter: '11.1.0', system_test: true } | |
| # database: PG 15/17/18 pinned to the known-stable 6.1/3.4 pair | |
| - { redmine_version: 6.1-stable, ruby_version: '3.4', db_version: 15-3.4 } | |
| - { redmine_version: 6.1-stable, ruby_version: '3.4', db_version: 17-3.5 } | |
| - { redmine_version: 6.1-stable, ruby_version: '3.4', db_version: 18-3.6, system_test: true } | |
| 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@v6 | |
| with: | |
| repository: redmine/redmine | |
| ref: ${{ matrix.redmine_version }} | |
| path: redmine | |
| - name: Checkout Plugin | |
| uses: actions/checkout@v6 | |
| with: | |
| path: redmine/plugins/${{ env.PLUGIN_NAME }} | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby_version }} | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install native gem system libraries | |
| # The runner image ships gcc/make/patch and Chrome (for the system | |
| # test); only the pg and rgeo-geos gems' headers still need apt, which | |
| # here hits Ubuntu's mirrors rather than a Debian container's. | |
| run: | | |
| sudo apt-get update --yes --quiet | |
| sudo apt-get install --yes --quiet --no-install-recommends libpq-dev libgeos-dev | |
| - name: Build plugin assets | |
| working-directory: redmine/plugins/${{ env.PLUGIN_NAME }} | |
| env: | |
| COREPACK_ENABLE_DOWNLOAD_PROMPT: "0" | |
| # typecheck + unit tests run once in the frontend job; here we only | |
| # build the assets the Ruby tests need. | |
| run: | | |
| corepack enable pnpm | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Prepare Redmine source | |
| working-directory: redmine | |
| run: | | |
| cat <<EOF > config/database.yml | |
| test: | |
| adapter: postgis | |
| database: redmine | |
| host: 127.0.0.1 | |
| 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/${{ env.PLUGIN_NAME }}/test/unit | |
| bundle exec rails test plugins/${{ env.PLUGIN_NAME }}/test/functional | |
| bundle exec rails test plugins/${{ env.PLUGIN_NAME }}/test/integration | |
| if [ "${{ matrix.system_test }}" = "true" ]; then | |
| bundle exec rails test plugins/${{ env.PLUGIN_NAME }}/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 |