-
Notifications
You must be signed in to change notification settings - Fork 28
84 lines (82 loc) · 2.57 KB
/
cicd.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
name: cicd
on:
push:
branches:
- main
pull_request:
jobs:
tests:
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "**/go.sum"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
version: v1.53
- name: Run go tests
run: |
go test ./...
go test -race ./...
- name: Build binary
run: make build
integration_tests:
needs: [tests]
strategy:
matrix:
os: [ubuntu-latest]
go-version: [1.20.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: setup host kernel parameters
run: ./build/set_kernel_params.sh
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "**/go.sum"
- name: Build gobmp container
run: make container REGISTRY_NAME=localhost IMAGE_VERSION=cicd
- name: Build validator binary
run: make validator
- name: pulling XRd container
run: docker pull sbezverk/xrd-control-plane:7.9.2
- name: check for gobmp container
run: docker images
- name: starts unicast v4 integration test
run: docker compose -f ./build/unicastv4-bgp/test_bed.yml up --detach
- name: check conection to kafka and bmp session with a router
id: session
run: ./build/monitor_container.sh gobmp
continue-on-error: true
- name: run validator for ipv4 unicast
id: validation
run: ./bin/validator --validate=true --kafka=127.0.0.1:9092 --msg-file=./testdata/validator/ipv4_unicast.msg
continue-on-error: true
- name: Check on failures
if: steps.session.outcome != 'success' || steps.validation.outcome != 'success'
run: |
docker ps -a
docker logs gobmp
docker logs xr-1
exit 1