-
Notifications
You must be signed in to change notification settings - Fork 61
84 lines (76 loc) · 2.08 KB
/
module_testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Go Client Tests
on:
pull_request:
branches:
- 'main'
- 'devel'
paths:
- 'main.go'
- 'routeros/*.go'
- '.github/workflows/*.yml'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
experimental: [false]
go:
- 1.21
os: [ubuntu-latest]
routeros_version:
- "7.12"
- "7.15"
- "7.16"
steps:
- name: Container check
run: |
echo "Wait for the container to finish launching..."
while true; do
docker logs routeros 2>&1 | grep MikroTik && break
echo "waiting..."
sleep 10
done
IP=$(docker inspect routeros --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
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- name: Get dependencies
run: |
go mod download
- name: Build
run: go build -v .
- name: Preparing RouterOS for testing
run: |
go run .github/scripts/setup_routeros.go
env:
ROS_USERNAME: admin
ROS_PASSWORD: ''
- name: Run client tests
run: go test -timeout 30m -v ./routeros
env:
ROS_HOSTURL: https://${ROS_IP_ADDRESS}
ROS_USERNAME: admin
ROS_PASSWORD: ''
ROS_INSECURE: true
TF_ACC: 1
ROS_VERSION: ${{ matrix.routeros_version }}
services:
routeros:
image: vaerhme/routeros:v${{ matrix.routeros_version }}
ports:
- 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