File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 5353 subject_groups : ${{ steps.split_subjects.outputs.subject_groups }}
5454 env :
5555 WORKING_DIRECTORY : rails_application
56+ services :
57+ postgres :
58+ image : postgres:17-alpine
59+ env :
60+ POSTGRES_DB : cqrs-es-sample-with-res_test
61+ POSTGRES_PASSWORD : secret
62+ ports :
63+ - 5432:5432
64+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
5665 steps :
5766 - uses : actions/checkout@v3
5867 - uses : ruby/setup-ruby@v1
6473 id : split_subjects
6574 working-directory : ${{ env.WORKING_DIRECTORY }}
6675 run : |
76+ # Ensure database is ready before listing subjects
77+ echo "Waiting for PostgreSQL to be ready..."
78+ until pg_isready -h localhost -p 5432 -U "postgres" -d "cqrs-es-sample-with-res_test"; do
79+ sleep 1
80+ done
81+ echo "PostgreSQL is ready."
82+
83+ RAILS_ENV=test bundle exec rails db:prepare
84+
6785 SUBJECT_LIST_OUTPUT=$(RAILS_ENV=test bundle exec mutant environment subject list)
6886 # Skip the first line (e.g., "Subjects in environment: 47") and read subjects into an array
6987 mapfile -t subjects_array < <(echo "$SUBJECT_LIST_OUTPUT" | tail -n +2 | sed 's/\x1b\[[0-9;]*m//g' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | awk 'NF')
You can’t perform that action at this time.
0 commit comments