Skip to content

Commit

Permalink
ci: Change the startup of the container
Browse files Browse the repository at this point in the history
  • Loading branch information
vaerh committed Dec 12, 2024
1 parent 8443848 commit aa4b9eb
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/module_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ jobs:
- "7.16"

steps:
- name: Container check
run: |
echo "Wait for the container to finish launching..."
while true; do
docker logs ${{ job.services.routeros.id }} 2>&1 | grep MikroTik && break
# docker logs ${{ job.services.routeros.id }} 2>&1
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"
docker inspect ${{ job.services.routeros.id }}
exit 5
- name: Check out code into the Go module directory
uses: actions/checkout@v4

Expand All @@ -47,12 +62,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
Expand All @@ -66,8 +80,8 @@ jobs:
- 443:443
- 8728:8728
- 8729:8729
volumes:
- /dev/net/tun:/dev/net/tun
options: >-
--cap-add=NET_ADMIN
--entrypoint /routeros/entrypoint_with_four_interfaces.sh
--device /dev/net/tun
--device /dev/kvm

0 comments on commit aa4b9eb

Please sign in to comment.