Skip to content

Commit

Permalink
Add CI check that db/schema.rb matches result of migrations
Browse files Browse the repository at this point in the history
Closes #245.
  • Loading branch information
tom93 committed Jan 5, 2024
1 parent b26315e commit 98bdbb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
ISOLATE_CGROUPS: false
ISOLATE_BRANCH: master

- name: Back up db/schema.rb # it will be overwritten when install.bash runs migrate.bash; back up the original so we can check if it's up to date
run: cp db/schema.rb db/schema.rb.git

- run: AUTOCONFIRM=true script/install.bash
env:
PGHOST: localhost
Expand All @@ -57,6 +60,9 @@ jobs:
#- run: bundle exec rake db:test:load # not required because script/install.bash runs db:migrate
- run: bundle exec rspec

- name: Check that db/schema.rb is up to date
run: diff -u db/schema.rb.git db/schema.rb || { echo "Error: db/schema.rb is out of date" >&2; exit 1; }

- uses: coverallsapp/github-action@v2

lint:
Expand Down

0 comments on commit 98bdbb9

Please sign in to comment.