Skip to content

Commit

Permalink
Merge pull request #74 from samply/fix/ci
Browse files Browse the repository at this point in the history
Fix CI pipeline
  • Loading branch information
TKussel authored Nov 20, 2022
2 parents 0aee473 + c3df7ac commit 585719b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

build-rust:
name: Build (Rust)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

strategy:
matrix:
Expand Down Expand Up @@ -61,14 +61,14 @@ jobs:
echo "profilestr=--profile $PROFILE" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.arch }}-${{ env.PROFILE }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: ${{ env.rustarch }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.arch }}-${{ env.PROFILE }}
- name: Build (${{ matrix.arch }})
uses: actions-rs/cargo@v1
with:
Expand Down
20 changes: 17 additions & 3 deletions dev/beamdev
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,23 @@ function start_bg {
[ -x ../artifacts/binaries-$ARCH ] || build_rust
docker-compose up --no-recreate -d
for ADDR in $P1 $P2; do
while [ "$(curl -s -o /dev/null -w '%{response_code}' $ADDR/v1/health)" != "200" ]; do
echo "Waiting for $P1 ..."
sleep 0.1
TRIES=1
while [ $TRIES -ne 0 ]; do
set +e
CODE=$(curl -s -o /tmp/body -w '%{response_code}' $ADDR/v1/health)
set -e
if [ "$CODE" == "200" ]; then
TRIES=0
else
echo "Waiting for $ADDR ... (try ${TRIES}/30, last response was: code=$OUT, body=\"$(cat /tmp/body 2>/dev/null)\")"
sleep 1
((TRIES=TRIES+1))
if [ $TRIES -ge 30 ]; then
echo "ERROR: $ADDR not available after 30 seconds. Giving up and printing docker-compose logs."
docker-compose logs
exit 5
fi
fi
done
done
echo "Services are up:"
Expand Down

0 comments on commit 585719b

Please sign in to comment.