Skip to content

masayag is testing out bloodinfo docker-compose πŸš€ #42

masayag is testing out bloodinfo docker-compose πŸš€

masayag is testing out bloodinfo docker-compose πŸš€ #42

Workflow file for this run

name: Build and test application on push
run-name: ${{ github.actor }} is testing out bloodinfo docker-compose πŸš€
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
POSTGRES_USER: mada
POSTGRES_PASSWORD: mada
POSTGRES_DB: bloodinfo
steps:
# need checkout before using docker-compose-action
- uses: actions/checkout@v3
- uses: adambirds/[email protected]
with:
compose-file: "docker-compose.yml"
down-flags: "--volumes --remove-orphans --rmi local"
test-container: "blood-info"
test-command: >
/bin/sh -c '
result=$(wget -q -O- --no-check-certificate https://localhost:8443/stations | jq ". | length");
if [ -n "$result" ] && [ "$result" -ne 0 ]; then
echo "Test passed: Result is not empty and not zero.";
exit 0; # Test passed
else
echo "Test failed: Result is empty or zero.";
exit 1; # Test failed
fi'