This commit is contained in:
@@ -36,10 +36,18 @@ jobs:
|
|||||||
/go_path
|
/go_path
|
||||||
/go_cache
|
/go_cache
|
||||||
key: go_path-${{ steps.hash-go.outputs.hash }}
|
key: go_path-${{ steps.hash-go.outputs.hash }}
|
||||||
- uses: harmon758/postgresql-action@v1
|
- name: Setup test database
|
||||||
with:
|
run: |
|
||||||
postgresql version: "16"
|
docker run -d --rm --name postgres_build_db \
|
||||||
postgresql user: ${{ env.POSTGRES_USER }}
|
-p $POSTGRES_PORT:5432 \
|
||||||
postgresql password: ${{ env.POSTGRES_PASSWORD }}
|
-e POSTGRES_USER=$POSTGRES_USER \
|
||||||
postgresql db: ${{ env.POSTGRES_DB }}
|
-e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
|
||||||
- run: cd Backend && go test ./...
|
-e POSTGRES_DB=$POSTGRES_DB \
|
||||||
|
postgres:16
|
||||||
|
while [[ $(docker logs postgres_build_db 2>&1 | grep -c "database system is ready to accept connections") == 0 ]]; do
|
||||||
|
sleep 1;
|
||||||
|
done;
|
||||||
|
- name: Run Go Tests
|
||||||
|
run: cd Backend && go test ./...
|
||||||
|
- name: Shutdown Postgres DB
|
||||||
|
run: docker stop postgres_build_db
|
||||||
|
|||||||
Reference in New Issue
Block a user