Skip to content

chore: add unique to the main SectionsContentStore constraint #508

chore: add unique to the main SectionsContentStore constraint

chore: add unique to the main SectionsContentStore constraint #508

Workflow file for this run

name: Verify
on: [push]
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.8
env:
POSTGRES_USER: "maglev"
POSTGRES_PASSWORD: "password"
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
gemfile: ["Gemfile.rails_7_2", "Gemfile"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Ruby and install gems using ${{ matrix.gemfile }}
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
- name: Install ImageMagick 🏞️
run: |
sudo apt-get update && sudo apt-get install -y imagemagick
- name: Setup test database
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
RAILS_ENV: test
MAGLEV_APP_DATABASE_USERNAME: "maglev"
MAGLEV_APP_DATABASE_PASSWORD: "password"
run: |
bin/rails db:setup
- name: Run Rails tests
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
MAGLEV_APP_DATABASE_USERNAME: "maglev"
MAGLEV_APP_DATABASE_PASSWORD: "password"
run: bundle exec rspec
- name: Setup test database (SQLite)
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
RAILS_ENV: test
USE_SQLITE: 1
run: |
cp spec/dummy/db/schema.rb spec/dummy/db/schema.pg.rb
cp spec/dummy/db/schema.sqlite.rb spec/dummy/db/schema.rb
cp spec/legacy_dummy/db/schema.rb spec/legacy_dummy/db/schema.pg.rb
cp spec/legacy_dummy/db/schema.sqlite.rb spec/legacy_dummy/db/schema.rb
bin/rails db:setup
- name: Run Rails tests (SQLite)
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
USE_SQLITE: true
run: bundle exec rspec
- name: Cleanup DB schema files
run: |
cp spec/dummy/db/schema.pg.rb spec/dummy/db/schema.rb
cp spec/legacy_dummy/db/schema.pg.rb spec/legacy_dummy/db/schema.rb
rm -f spec/dummy/db/maglev_engine_test.sqlite3
rm -f spec/legacy_dummy/db/maglev_engine_test.sqlite3