зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-03 10:16:18 +03:00
refactor: Modernize CI with Appraisal gem and consolidate workflows
- Add Appraisal gem for managing multiple test gemfiles - Create test matrix for Rails 6.1-8.0 and ActiveAdmin 2.9-4.x - Consolidate multiple workflow files into single ci.yml - Use matrix strategy to test across Ruby 3.0-3.3 - Remove deprecated individual workflow files - Add gemfiles/ to gitignore as they're generated - Improve backward compatibility support
Этот коммит содержится в:
102
.github/workflows/ci.yml
поставляемый
Обычный файл
102
.github/workflows/ci.yml
поставляемый
Обычный файл
@@ -0,0 +1,102 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby: ['3.0', '3.1', '3.2', '3.3']
|
||||
gemfile:
|
||||
- rails_6.1_active_admin_2.9
|
||||
- rails_7.0_active_admin_2.x
|
||||
- rails_7.0_active_admin_3.x
|
||||
- rails_7.1_active_admin_3.x
|
||||
- rails_7.2_active_admin_3.x
|
||||
- rails_7.2_active_admin_4.x
|
||||
- rails_8.0_active_admin_4.x
|
||||
exclude:
|
||||
# Rails 8 requires Ruby 3.2+
|
||||
- ruby: '3.0'
|
||||
gemfile: rails_8.0_active_admin_4.x
|
||||
- ruby: '3.1'
|
||||
gemfile: rails_8.0_active_admin_4.x
|
||||
# ActiveAdmin 4 requires Ruby 3.2+
|
||||
- ruby: '3.0'
|
||||
gemfile: rails_7.2_active_admin_4.x
|
||||
- ruby: '3.1'
|
||||
gemfile: rails_7.2_active_admin_4.x
|
||||
|
||||
env:
|
||||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
|
||||
RAILS_ENV: test
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: true
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: spec/dummy/package-lock.json
|
||||
|
||||
- name: Install npm dependencies for dummy app
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm install
|
||||
|
||||
- name: Build assets for dummy app
|
||||
run: |
|
||||
cd spec/dummy
|
||||
# Build JavaScript with esbuild
|
||||
npm run build:js || true
|
||||
# Build CSS with Tailwind for AA4
|
||||
if [[ "${{ matrix.gemfile }}" == *"4.x"* ]]; then
|
||||
npm run build:css || true
|
||||
fi
|
||||
|
||||
- name: Database setup
|
||||
run: |
|
||||
cd spec/dummy
|
||||
bundle exec rails db:create db:migrate db:test:prepare
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --format progress
|
||||
|
||||
- name: Upload screenshots on failure
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-screenshots-${{ matrix.ruby }}-${{ matrix.gemfile }}
|
||||
path: spec/dummy/tmp/capybara
|
||||
if-no-files-found: ignore
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.3'
|
||||
bundler-cache: true
|
||||
|
||||
- name: Run RuboCop
|
||||
run: bundle exec rubocop --force-exclusion
|
||||
39
.github/workflows/linters.yml
поставляемый
39
.github/workflows/linters.yml
поставляемый
@@ -1,39 +0,0 @@
|
||||
---
|
||||
name: Linters
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
reviewdog:
|
||||
name: Reviewdog
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
RAILS_VERSION: 7.0
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.0
|
||||
bundler-cache: true
|
||||
|
||||
- name: Set up Reviewdog
|
||||
uses: reviewdog/action-setup@v1
|
||||
with:
|
||||
reviewdog_version: latest
|
||||
|
||||
- name: Run Reviewdog
|
||||
env:
|
||||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
reviewdog -fail-on-error -reporter=github-pr-review -runners=fasterer,rubocop
|
||||
|
||||
# NOTE: check with: reviewdog -fail-on-error -reporter=github-pr-review -runners=fasterer -diff="git diff" -tee
|
||||
148
.github/workflows/specs.yml
поставляемый
148
.github/workflows/specs.yml
поставляемый
@@ -1,148 +0,0 @@
|
||||
---
|
||||
name: Specs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
push:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
test_legacy:
|
||||
runs-on: ubuntu-latest
|
||||
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / AA ${{ matrix.activeadmin }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Legacy ActiveAdmin 2.x/3.x support
|
||||
- ruby: '3.0'
|
||||
rails: '7.0'
|
||||
activeadmin: '~> 2.9'
|
||||
- ruby: '3.1'
|
||||
rails: '7.1'
|
||||
activeadmin: '~> 3.0'
|
||||
- ruby: '3.2'
|
||||
rails: '7.2'
|
||||
activeadmin: '~> 3.0'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
gem install bundler
|
||||
bundle config set --local without 'development'
|
||||
bundle install --jobs 4 --retry 3
|
||||
env:
|
||||
RAILS_VERSION: ${{ matrix.rails }}
|
||||
ACTIVEADMIN_VERSION: ${{ matrix.activeadmin }}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install NPM dependencies
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm install
|
||||
|
||||
- name: Build assets
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm run build
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
env:
|
||||
RAILS_VERSION: ${{ matrix.rails }}
|
||||
ACTIVEADMIN_VERSION: ${{ matrix.activeadmin }}
|
||||
|
||||
- name: Archive screenshots on failure
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-screenshots-legacy-${{ matrix.ruby }}-${{ matrix.rails }}
|
||||
path: spec/dummy/tmp/capybara
|
||||
|
||||
test_activeadmin_4:
|
||||
runs-on: ubuntu-latest
|
||||
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / AA 4.x
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby: ['3.2', '3.3']
|
||||
rails: ['7.2', '8.0']
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: false
|
||||
|
||||
- name: Install dependencies for AA4
|
||||
run: |
|
||||
gem install bundler
|
||||
bundle config set --local without 'development'
|
||||
bundle install --jobs 4 --retry 3
|
||||
env:
|
||||
RAILS_VERSION: ${{ matrix.rails }}
|
||||
ACTIVEADMIN_VERSION: ''
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install NPM dependencies
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm install
|
||||
|
||||
- name: Build assets
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm run build
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
env:
|
||||
RAILS_VERSION: ${{ matrix.rails }}
|
||||
ACTIVEADMIN_VERSION: '4.0'
|
||||
|
||||
- name: Archive screenshots on failure
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-screenshots-aa4-${{ matrix.ruby }}-${{ matrix.rails }}
|
||||
path: spec/dummy/tmp/capybara
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.2'
|
||||
bundler-cache: true
|
||||
|
||||
- name: Run RuboCop
|
||||
run: bundle exec rubocop --parallel
|
||||
43
.github/workflows/specs_rails61.yml
поставляемый
43
.github/workflows/specs_rails61.yml
поставляемый
@@ -1,43 +0,0 @@
|
||||
---
|
||||
name: Specs Rails 6.1 with ActiveAdmin 2.9
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: ['3.0', '3.1', '3.2']
|
||||
|
||||
env:
|
||||
RAILS_VERSION: 6.0
|
||||
ACTIVEADMIN_VERSION: 2.9.0
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: true
|
||||
|
||||
- name: Database setup
|
||||
run: bin/rails db:create db:migrate db:test:prepare
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
|
||||
- name: On failure, archive screenshots as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-failed-screenshots
|
||||
path: spec/dummy/tmp/screenshots
|
||||
42
.github/workflows/specs_rails70.yml
поставляемый
42
.github/workflows/specs_rails70.yml
поставляемый
@@ -1,42 +0,0 @@
|
||||
---
|
||||
name: Specs Rails 7.0
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: ['3.0', '3.1', '3.2']
|
||||
|
||||
env:
|
||||
RAILS_VERSION: 7.0
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: true
|
||||
|
||||
- name: Database setup
|
||||
run: bin/rails db:create db:migrate db:test:prepare
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
|
||||
- name: On failure, archive screenshots as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-failed-screenshots
|
||||
path: spec/dummy/tmp/screenshots
|
||||
42
.github/workflows/specs_rails71.yml
поставляемый
42
.github/workflows/specs_rails71.yml
поставляемый
@@ -1,42 +0,0 @@
|
||||
---
|
||||
name: Specs Rails 7.1
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: ['3.2', '3.4']
|
||||
|
||||
env:
|
||||
RAILS_VERSION: 7.1
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: true
|
||||
|
||||
- name: Database setup
|
||||
run: bin/rails db:create db:migrate db:test:prepare
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
|
||||
- name: On failure, archive screenshots as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-failed-screenshots
|
||||
path: spec/dummy/tmp/screenshots
|
||||
42
.github/workflows/specs_rails72.yml
поставляемый
42
.github/workflows/specs_rails72.yml
поставляемый
@@ -1,42 +0,0 @@
|
||||
---
|
||||
name: Specs Rails 7.2
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: ['3.2', '3.4']
|
||||
|
||||
env:
|
||||
RAILS_VERSION: 7.2
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: true
|
||||
|
||||
- name: Database setup
|
||||
run: bin/rails db:create db:migrate db:test:prepare
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
|
||||
- name: On failure, archive screenshots as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-failed-screenshots
|
||||
path: spec/dummy/tmp/screenshots
|
||||
64
.github/workflows/specs_rails80.yml
поставляемый
64
.github/workflows/specs_rails80.yml
поставляемый
@@ -1,64 +0,0 @@
|
||||
---
|
||||
name: Specs Rails 8.0
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: ['3.2', '3.3']
|
||||
|
||||
env:
|
||||
RAILS_VERSION: 8.0
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
bundler-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
gem install bundler
|
||||
bundle install --jobs 4 --retry 3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install NPM dependencies
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm install
|
||||
|
||||
- name: Build assets
|
||||
run: |
|
||||
cd spec/dummy
|
||||
npm run build
|
||||
|
||||
- name: Database setup
|
||||
run: |
|
||||
cd spec/dummy
|
||||
bundle exec rails db:create db:migrate db:test:prepare
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile
|
||||
|
||||
- name: On failure, archive screenshots as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: test-failed-screenshots-rails8-${{ matrix.ruby }}
|
||||
path: spec/dummy/tmp/capybara
|
||||
Ссылка в новой задаче
Block a user