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

fix(CI): Add docker build and curl check #214

Merged
merged 8 commits into from
Dec 13, 2024
33 changes: 31 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "main" ]

jobs:
build:
binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,4 +18,33 @@ jobs:
go-version: 1.22

- name: Build App
run: make eigenda-proxy
run: make eigenda-proxy

docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build container
uses: docker/build-push-action@v5
with:
push: false
context: .
tags: eigenda-proxy

- name: Run container as background process
shell: bash
run: |
docker run -d \
-p 6666:6666 \
-e EIGENDA_PROXY_ADDR=0.0.0.0 \
-e EIGENDA_PROXY_PORT=6666 \
-e EIGENDA_PROXY_MEMSTORE_ENABLED=true \
-e EIGENDA_PROXY_EIGENDA_CERT_VERIFICATION_DISABLED=true \
eigenda-proxy

- name: Wait for rpc to come up
shell: bash
run: |
${{ github.workspace }}/scripts/wait-for.sh
13 changes: 13 additions & 0 deletions scripts/wait-for.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# poll the proxy endpoint until we get a 0 return code or 2mins have passed, in that case exit 1
timeout_time=$(($(date +%s) + 120))

while (( $(date +%s) <= timeout_time )); do
if curl -X GET 'http://localhost:6666/health'; then
exit 0
else
sleep 5
fi
done

exit 1
Loading