Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add simple test #25

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: prepare .env
run: cp env.sample .env
- name: docker compose up
run: docker compose up -d
- name: Wait for HTTP 200 response from homepage
run: |
max=30
i=0
echo "Waiting for localhost to respond with status code 200..."
until curl --head --fail http://localhost:7007; do
i=$((i+1))
if [ "$i" -ge "$max" ]; then
echo "Max retries reached. Exiting."
docker compose logs
exit 1
fi
echo "($i/$max)Waiting for http://localhost:7007 to return HTTP 200..."
sleep 5
done
echo "RHDH is ready!"
curl --insecure http://localhost:7007
Loading