From 1cdc69c5477a83804bddebe1ce28f285aa0394d5 Mon Sep 17 00:00:00 2001 From: Vaerh Date: Thu, 12 Dec 2024 23:11:45 +0300 Subject: [PATCH] ci: Change the startup of the container --- .github/workflows/module_testing.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module_testing.yml b/.github/workflows/module_testing.yml index 8e74c468..264d8419 100644 --- a/.github/workflows/module_testing.yml +++ b/.github/workflows/module_testing.yml @@ -25,6 +25,19 @@ jobs: - "7.16" steps: + - name: Container check + run: | + echo "The container ID: ${{ job.services.routeros.id }}" + echo "Wait for the container to finish launching..." + while true; do + docker logs ${{ job.services.routeros.id }} 2>&1 | grep MikroTik && break + echo "waiting..." + sleep 10 + done + IP=$(docker inspect ${{ job.services.routeros.id }} --format '{{.NetworkSettings.IPAddress}}') + echo "IP address: ${IP}" + echo "ROS_IP_ADDRESS=${IP}" >> "$GITHUB_ENV" + - name: Check out code into the Go module directory uses: actions/checkout@v4 @@ -47,12 +60,11 @@ jobs: env: ROS_USERNAME: admin ROS_PASSWORD: '' - ROS_IP_ADDRESS: 127.0.0.1 - name: Run client tests run: go test -timeout 30m -v ./routeros env: - ROS_HOSTURL: https://127.0.0.1 + ROS_HOSTURL: https://${ROS_IP_ADDRESS} ROS_USERNAME: admin ROS_PASSWORD: '' ROS_INSECURE: true