dev/actions #26
@@ -6,7 +6,15 @@ jobs:
|
|||||||
testing:
|
testing:
|
||||||
name: check and test
|
name: check and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: root
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: arbeitszeitmessung
|
||||||
env:
|
env:
|
||||||
|
POSTGRES_HOST: postgres
|
||||||
POSTGRES_USER: root
|
POSTGRES_USER: root
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: password
|
||||||
POSTGRES_DB: arbeitszeitmessung
|
POSTGRES_DB: arbeitszeitmessung
|
||||||
@@ -36,18 +44,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 }}
|
||||||
- name: Setup test database
|
# - name: Setup test database
|
||||||
run: |
|
# run: |
|
||||||
docker run -d --rm --name postgres_build_db \
|
# docker run -d --rm --name postgres_build_db \
|
||||||
-p $POSTGRES_PORT:5432 \
|
# -p $POSTGRES_PORT:5432 \
|
||||||
-e POSTGRES_USER=$POSTGRES_USER \
|
# -e POSTGRES_USER=$POSTGRES_USER \
|
||||||
-e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
|
# -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
|
||||||
-e POSTGRES_DB=$POSTGRES_DB \
|
# -e POSTGRES_DB=$POSTGRES_DB \
|
||||||
postgres:16
|
# postgres:16
|
||||||
while [[ $(docker logs postgres_build_db 2>&1 | grep -c "database system is ready to accept connections") == 0 ]]; do
|
# while [[ $(docker logs postgres_build_db 2>&1 | grep -c "database system is ready to accept connections") == 0 ]]; do
|
||||||
sleep 1;
|
# sleep 1;
|
||||||
done;
|
# done;
|
||||||
- name: Run Go Tests
|
- name: Run Go Tests
|
||||||
run: cd Backend && go test ./...
|
run: cd Backend && go test ./...
|
||||||
- name: Shutdown Postgres DB
|
# - name: Shutdown Postgres DB
|
||||||
run: docker stop postgres_build_db
|
# run: docker stop postgres_build_db
|
||||||
|
|||||||
Reference in New Issue
Block a user