From f681f8d2f9e0ce556978ee4fe8795480c731abdb Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:12:25 +0100 Subject: [PATCH] Add a new step redoing the last migration --- .gitea/workflows/tests.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 877a794..5aaaff8 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -10,7 +10,7 @@ concurrency: jobs: unit_tests: runs-on: ubuntu-latest - services: + services: &services postgres: image: postgres env: @@ -49,4 +49,23 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - - run: bundle exec rubocop --force-exclusion --parallel \ No newline at end of file + - run: bundle exec rubocop --force-exclusion --parallel + reversible_migrations: + runs-on: ubuntu-latest + services: *services + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: ruby/setup-ruby@v1.207.0 + - run: bundle install + - name: Wait until Postgres is ready to accept connections + run: | + apt-get update && apt-get install -f -y postgresql-client + until pg_isready -h postgres -U postgres -d postgres + do + sleep 1 + echo "Trying again" + done + - run: bundle exec rake db:schema:load + - run: bundle exec rake db:migrate:redo \ No newline at end of file