Skip to content

Commit

Permalink
ci: run ut and e2e in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed May 13, 2020
1 parent dfbe7de commit 0665f2e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-arm64-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- master
- feat/github-action
paths-ignore:
- 'docs/**'
- 'dist/**'
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: Build x86 Image

on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- 'dist/**'
- 'yamls/**'
push:
branches:
- master
- feat/github-action
paths-ignore:
- 'docs/**'
- 'dist/**'
Expand All @@ -20,12 +26,32 @@ jobs:
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1.4.0

- name: Unit test
run: |
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/onsi/gomega/...
make ut
- name: Build
run: make release

- name: Init Kind
run: |
sudo make kind-init
- name: Run E2E
run: |
sudo kubectl cluster-info
sudo chmod 666 /home/runner/.kube/config
make e2e
- name: Push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ suspend:

kind-init:
kind delete cluster --name=kube-ovn
kind create cluster --config yamls/kind.yaml --name kube-ovn
kind create cluster --config yamls/kind-single.yaml --name kube-ovn
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
kubectl label node kube-ovn-control-plane kube-ovn/role=master --overwrite
kubectl apply -f yamls/crd.yaml
kubectl apply -f yamls/ovn.yaml
kubectl apply -f yamls/kube-ovn.yaml
bash dist/images/install.sh

kind-init-ha:
kind delete cluster --name=kube-ovn
kind create cluster --config yamls/kind.yaml --name kube-ovn
kind create cluster --config yamls/kind-ha.yaml --name kube-ovn
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
bash dist/images/install.sh

Expand All @@ -98,8 +95,6 @@ uninstall:
bash dist/images/cleanup.sh

e2e:
docker pull index.alauda.cn/claas/pause:3.1
kind load docker-image --name kube-ovn index.alauda.cn/claas/pause:3.1
ginkgo -p --slowSpecThreshold=60 test/e2e

ut:
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions yamls/kind-single.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
networking:
disableDefaultCNI: true
nodes:
- role: control-plane
image: kindest/node:v1.18.0

0 comments on commit 0665f2e

Please sign in to comment.