diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e50c716..0306d20b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: branches: [ "main" ] jobs: - build: + binary: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -18,4 +18,33 @@ jobs: go-version: 1.22 - name: Build App - run: make eigenda-proxy \ No newline at end of file + 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 \ No newline at end of file diff --git a/scripts/wait-for.sh b/scripts/wait-for.sh new file mode 100755 index 00000000..beb917e9 --- /dev/null +++ b/scripts/wait-for.sh @@ -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 \ No newline at end of file