From 028cf8a5599f9e1b95ec1f26b94bb8423d8a73ef Mon Sep 17 00:00:00 2001 From: Antoine SEIN <142824551+asein-sinch@users.noreply.github.com> Date: Thu, 25 Jul 2024 08:36:56 +0200 Subject: [PATCH 1/3] DEVEXP-493: Use healthcheck script --- .github/workflows/run-ci.yaml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/run-ci.yaml b/.github/workflows/run-ci.yaml index 8b879719..8084c8cd 100644 --- a/.github/workflows/run-ci.yaml +++ b/.github/workflows/run-ci.yaml @@ -29,6 +29,7 @@ jobs: uses: actions/checkout@v3 with: repository: sinch/sinch-sdk-mockserver + ref: DEVEXP-493_Healthcheck-script token: ${{ secrets.PAT_CI }} fetch-depth: 0 path: sinch-sdk-mockserver @@ -43,26 +44,7 @@ jobs: - name: Wait for the mock servers to be healthy run: | cd sinch-sdk-mockserver - servers=( - "authentication-server" - "fax-server" - "numbers-server" - "conversation-server" - "conversation-templates-server" - ) - - for server in "${servers[@]}"; do - SECONDS=0 - while ! docker inspect --format='{{json .State.Health.Status}}' $(docker-compose ps -q $server) | grep -q '"healthy"'; do - if [ $SECONDS -ge 30 ]; then - echo "Timeout: $server did not become healthy within 30 seconds." - exit 1 - fi - echo "Waiting for $server to be healthy..." - sleep 2 - done - echo "$server is healthy!" - done + ./scripts/healthcheck.sh - name: Create target directories for feature files run: | mkdir -p ./packages/fax/tests/e2e/features From bd49185d2193b3eb842c3c8fb80abc445ff59337 Mon Sep 17 00:00:00 2001 From: Antoine SEIN <142824551+asein-sinch@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:41:52 +0200 Subject: [PATCH 2/3] Make script executable --- .github/workflows/run-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-ci.yaml b/.github/workflows/run-ci.yaml index 8084c8cd..f2cb6f9c 100644 --- a/.github/workflows/run-ci.yaml +++ b/.github/workflows/run-ci.yaml @@ -44,6 +44,7 @@ jobs: - name: Wait for the mock servers to be healthy run: | cd sinch-sdk-mockserver + chmod +x ./scripts/healthcheck.sh ./scripts/healthcheck.sh - name: Create target directories for feature files run: | From ab7a144bd293d5651f8f3a08b82fcfd9526347d0 Mon Sep 17 00:00:00 2001 From: Antoine SEIN <142824551+asein-sinch@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:51:47 +0200 Subject: [PATCH 3/3] Clone the main branch from the mockserver repo --- .github/workflows/run-ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-ci.yaml b/.github/workflows/run-ci.yaml index f2cb6f9c..151867dd 100644 --- a/.github/workflows/run-ci.yaml +++ b/.github/workflows/run-ci.yaml @@ -29,7 +29,6 @@ jobs: uses: actions/checkout@v3 with: repository: sinch/sinch-sdk-mockserver - ref: DEVEXP-493_Healthcheck-script token: ${{ secrets.PAT_CI }} fetch-depth: 0 path: sinch-sdk-mockserver