Redo migrations after running specs
Some checks failed
Run unit tests / rubocop (pull_request) Successful in 52s
Run unit tests / check-licenses (pull_request) Successful in 1m10s
Run unit tests / copyright_notice (pull_request) Successful in 1m37s
Run unit tests / unit_tests (pull_request) Failing after 2m29s
Run unit tests / build-static-assets (pull_request) Has been skipped

This commit is contained in:
Manuel Bustillo 2025-01-24 08:55:26 +01:00
parent 139502c69a
commit ac470a802b

View File

@ -34,6 +34,12 @@ jobs:
sleep 1
echo "Trying again"
done
- run: |
bundle exec rake db:schema:load
bundle exec rspec
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
- name: Get all migrations added
id: changed-migration-files
uses: tj-actions/changed-files@v45
@ -45,18 +51,13 @@ jobs:
env:
ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }}
run: |
echo ${#ALL_CHANGED_FILES[@]}
echo ${#ALL_CHANGED_FILES[@]} migrations changed:
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- run: |
exit 1
bundle exec rake db:schema:load db:migrate:status db:migrate:redo
bundle exec rake db:migrate:redo STEP=${#ALL_CHANGED_FILES[@]}
git diff --exit-code db/schema.rb
bundle exec rspec
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
- name: Clean up containers generated by this flow
if: failure()
run: docker ps --filter network=$JOB_CONTAINER_NAME-$GITHUB_JOB-network --filter name=$JOB_CONTAINER_NAME-* --format "{{.ID}}" | xargs docker rm -f