Skip to content

Commit

Permalink
workflow 9
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig committed Feb 20, 2025
1 parent f5370a0 commit f3b6783
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/api-state-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Install api libraries
working-directory: ./api/source
run: npm ci
- name: Docker run MySQL
working-directory: ./api/source
run: |
Expand All @@ -96,7 +93,17 @@ jobs:
- name: Wait for MySQL
working-directory: ./api/source
run: |
timeout 30 docker logs -f stig-manager-db 2>&1 | grep -q "ready for connections"
for i in {1..10}; do
echo "Waiting for MySQL to start"
if docker exec stig-manager-db mysql -ustigman -pstigman -e "SELECT 1" stigman &> /dev/null; then
echo "MySQL is up"
break
fi
sleep 1
done
- name: Install api libraries
working-directory: ./api/source
run: npm ci
- name: Run API
working-directory: ./api/source
run: |
Expand All @@ -109,9 +116,10 @@ jobs:
exit 1
elif [ $exit_code -eq 1 ]; then
echo "api exited with code 1"
exit 1
exit 0
else
echo "api exited normally"
exit 1
fi
- name: Check MySQL preflight failures
working-directory: ./api/source
Expand Down

0 comments on commit f3b6783

Please sign in to comment.