File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 93
93
key : ${{ runner.os }}-mypy-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }}
94
94
- name : Run ${{ matrix.name }}
95
95
run : ${{ matrix.command }}
96
+
97
+ check_db :
98
+ name : Check Database Consistency
99
+ needs : build
100
+ runs-on : depot-ubuntu-22.04-arm
101
+ continue-on-error : true
102
+ container :
103
+ image : registry.depot.dev/rltf7cln5v:${{ needs.build.outputs.buildId }}
104
+ credentials :
105
+ username : x-token
106
+ password : ${{ needs.build.outputs.token }}
107
+ services :
108
+ postgres :
109
+ image : postgres:16.1
110
+ ports :
111
+ - 5432:5432
112
+ env :
113
+ POSTGRES_DB : warehouse
114
+ POSTGRES_HOST_AUTH_METHOD : trust # never do this in production!
115
+ POSTGRES_INITDB_ARGS : ' --no-sync --set fsync=off --set full_page_writes=off'
116
+ # Set health checks to wait until postgres has started
117
+ options : --health-cmd "pg_isready --username=postgres --dbname=postgres" --health-interval 10s --health-timeout 5s --health-retries 5
118
+ steps :
119
+ - name : Check out repository
120
+ uses : actions/checkout@v4
121
+ - name : Dotenv Action
122
+ # We need to load the environment variables to run the CLI
123
+ id : dotenv
124
+ uses : falti/dotenv-action@v1
125
+ with :
126
+ path : dev/environment
127
+ export-variables : true
128
+ keys-case : upper
129
+ - name : Check Database
130
+ run : bin/db-check
131
+ env :
132
+ # override the hostname set in `dev/environment`
133
+ DATABASE_URL : ' postgresql+psycopg://postgres@postgres/warehouse'
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ # Check for outstanding database migrations
5
+ python -m warehouse db upgrade head
6
+ python -m warehouse db check
You can’t perform that action at this time.
0 commit comments