2023.9.15 会议纪要 (#526) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: bpftool-v7.2.0-amd64 | |
# - name: Install Docker | |
# run: | | |
# sudo snap refresh | |
# sudo snap install docker | |
- name: Install Minikube | |
uses: medyagh/setup-minikube@latest | |
id: minikube | |
# with: | |
# driver: docker | |
# minikube-version: 1.24.0 | |
# kubernetes-version: v1.26.6 | |
# container-runtime: containerd | |
- name: Setup testing environments | |
run: | | |
kubectl apply -f eBPF_Supermarket/TrafficManager/acceptance/testdata/k8s/ | |
- name: Install eBPF development tools | |
run: | | |
sudo ln -s /usr/bin/llvm-strip-14 /usr/bin/llvm-strip | |
# sudo apt install -y llvm clang | |
- name: Build bpftool | |
if: steps.cache-bpftool.outputs.cache-hit != 'true' | |
run: | | |
rm -rf bpftool && mkdir bpftool && cd bpftool | |
wget https://github.com/libbpf/bpftool/releases/download/v7.2.0/bpftool-v7.2.0-amd64.tar.gz | |
sudo tar -xzf bpftool-v7.2.0-amd64.tar.gz | |
rm -f bpftool-v7.2.0-amd64.tar.gz | |
sudo chmod +x bpftool | |
- name: Install bpftool | |
run: | | |
sudo cp bpftool/bpftool /usr/bin/ | |
- 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: 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 | |
- name: Test | |
run: | | |
cd eBPF_Supermarket/TrafficManager/ | |
make test |