Skip to content

Initialize basic development framework for TrafficManager #13

Initialize basic development framework for TrafficManager

Initialize basic development framework for TrafficManager #13

name: Traffic Manager
on:
push:
branches:
- "*"
paths:
- 'eBPF_Supermarket/TrafficManager/**'
- '.github/workflows/net_traffic_manager.yml'
pull_request:
branches:
- "*"
paths:
- 'eBPF_Supermarket/TrafficManager/**'
- '.github/workflows/net_traffic_manager.yml'
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Cache bpftool build directory
id: cache-bpftool
uses: actions/cache@v3
with:
path: bpftool
key: ${{ runner.os }}-bpftool
# - name: Cache go pkg directory
# id: cache-go
# uses: actions/cache@v3
# with:
# path: ${{ GOPATH }}
# key: ${{ runner.os }}-go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: eBPF_Supermarket/TrafficManager/go.mod
cache-dependency-path: eBPF_Supermarket/TrafficManager/go.sum
# - name: Install Docker
# run: |
# sudo snap refresh
# sudo snap install docker
# - name: Install Minikube
# run: |
# sudo snap install kubectl --classic
# curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
# sudo install minikube-linux-amd64 /usr/local/bin/minikube
# sudo minikube start --kubernetes-version=1.26.6 --force
- name: Install eBPF development tools
run: |
sudo apt install -y llvm clang
- name: Build bpftool
if: steps.cache-bpftool.outputs.cache-hit != 'false'
run: |
sudo apt install libbfd-dev libcap-dev libelf-dev
git clone --recurse-submodules https://github.com/libbpf/bpftool.git
sudo make install -C bpftool/src/
- name: Install bpftool
run: |
sudo cp bpftool/src/bpftool /usr/bin/
- name: Load Dependency
run: |
cd eBPF_Supermarket/TrafficManager/
sudo go mod tidy
- name: Build
run: |
cd eBPF_Supermarket/TrafficManager/
sudo make init
sudo make build
- name: Run
run: |
cd eBPF_Supermarket/TrafficManager/
sudo -E timeout 10 ./main || if [[ $? != 124 && $? != 0 ]]; then exit $?; fi