[CI/CD] Add example test to Github/Actions

This commit is contained in:
Hui Yu
2021-01-12 16:23:37 +08:00
parent ac47de2daf
commit 2b77421c90
7 changed files with 34 additions and 8 deletions

View File

@@ -34,3 +34,9 @@ jobs:
run: |
cd examples/
make
- name: Create k8s kind cluster
uses: helm/kind-action@v1.1.0
- name: Test examples
run: |
cd examples/
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/kubernetes/build/ make test

View File

@@ -19,3 +19,10 @@ clean:
cd auth_provider; make clean
cd watch_list_pod; make clean
cd multi_thread; make clean
test:
cd create_pod; make test; sleep 10
cd list_pod; make test
cd delete_pod; make test
cd generic; make test
cd multi_thread; make test

View File

@@ -1,8 +1,11 @@
INCLUDE:=-I../../kubernetes/include -I../../kubernetes/model -I../../kubernetes/api -I../../kubernetes/config
LIBS:=-L../../kubernetes/build -lkubernetes -lyaml
CFLAGS:=-g
BIN:=create_pod_bin
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o create_pod_bin
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./create_pod_bin
rm ./$(BIN)
test:
./$(BIN)

View File

@@ -7,3 +7,5 @@ all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./$(BIN)
test:
./$(BIN)

View File

@@ -1,8 +1,11 @@
INCLUDE:=-I../../kubernetes/include -I../../kubernetes/model -I../../kubernetes/api -I../../kubernetes/config
LIBS:=-L../../kubernetes/build -lkubernetes -lyaml
CFLAGS:=-g
BIN:=generic_bin
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o generic_bin
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./generic_bin
rm ./$(BIN)
test:
./$(BIN)

View File

@@ -1,8 +1,11 @@
INCLUDE:=-I../../kubernetes/include -I../../kubernetes/model -I../../kubernetes/api -I../../kubernetes/config
LIBS:=-L../../kubernetes/build -lkubernetes -lyaml
CFLAGS:=-g
BIN:=list_pod_bin
all:
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o list_pod_bin
gcc main.c $(CFLAGS) $(INCLUDE) $(LIBS) -o $(BIN)
clean:
rm ./list_pod_bin
rm ./$(BIN)
test:
./$(BIN)

View File

@@ -11,6 +11,8 @@ all: $(OBJECTS)
$(OBJECTS): %.o: %.c
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
.PHONY : clean
.PHONY : clean test
clean:
rm $(BIN) $(OBJECTS)
rm $(BIN) $(OBJECTS)
test:
./$(BIN)