From 1acb5b419151e65942a2d6ae8ce3ac2491c0dccd Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:07:57 +0530 Subject: [PATCH 1/7] feat: integ for go code build using github action --- .github/workflows/go.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..20cc3e5 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,28 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.16 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... From 132ea39d5e6c70fa22af6bec7cdab80b1172ec82 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:22:54 +0530 Subject: [PATCH 2/7] feat: support for build using make --- .github/workflows/go.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 20cc3e5..5e30f88 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,5 +24,9 @@ jobs: - name: Build run: go build -v ./... + - name: build using make + run: | + GOPATH=$(go env GOPATH) make clean && make -j$nproc build + - name: Test run: go test -v ./... From 6de8520aa1f0095917d14eef02d68c5dd67ea93c Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:31:09 +0530 Subject: [PATCH 3/7] feat: automation for test, test-cov, networkedge image build --- .github/workflows/go.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5e30f88..6c77c2f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,9 +24,29 @@ jobs: - name: Build run: go build -v ./... - - name: build using make + - name: Build using make run: | GOPATH=$(go env GOPATH) make clean && make -j$nproc build - name: Test run: go test -v ./... + + - name: Test Go code using make + run: | + GOPATH=$(go env GOPATH) make clean && make -j$nproc test + + - name: Coverage tests on Go code using make + run: | + GOPATH=$(go env GOPATH) make clean && make -j$nproc test-cov + + - name: Build certsigner image using make + run: | + GOPATH=$(go env GOPATH) make clean && make -j$nproc certsigner + + - name: Build certrequester image using make + run: | + GOPATH=$(go env GOPATH) make clean && make -j$nproc certrequester + + - name: Build networkedge image using make + run: | + GOPATH=$(go env GOPATH) make clean && make -j$nproc networkedge From 01ea4b33b49a4270dc442669ad277812bcbfc860 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:42:01 +0530 Subject: [PATCH 4/7] chore: Setup ginkgo for make test --- .github/workflows/go.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6c77c2f..ba3df63 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,6 +31,9 @@ jobs: - name: Test run: go test -v ./... + - name: Setup ginkgo for make test + run: go install github.com/onsi/ginkgo/v2/ginkgo + - name: Test Go code using make run: | GOPATH=$(go env GOPATH) make clean && make -j$nproc test From 1d768cb14598713f98289a8d0e75b9fb70583659 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:46:21 +0530 Subject: [PATCH 5/7] chore : fix ginko --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ba3df63..df22051 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -32,7 +32,7 @@ jobs: run: go test -v ./... - name: Setup ginkgo for make test - run: go install github.com/onsi/ginkgo/v2/ginkgo + run: go get github.com/onsi/ginkgo/v2/ginkgo - name: Test Go code using make run: | From 52d3d9cd0f0e806abd7cd6d98703aba91f3c4ba1 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:51:49 +0530 Subject: [PATCH 6/7] chore: disable test using ginko --- .github/workflows/go.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index df22051..8b20884 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,12 +31,12 @@ jobs: - name: Test run: go test -v ./... - - name: Setup ginkgo for make test - run: go get github.com/onsi/ginkgo/v2/ginkgo +# - name: Setup ginkgo for make test +# run: go get github.com/onsi/ginkgo/v2/ginkgo - - name: Test Go code using make - run: | - GOPATH=$(go env GOPATH) make clean && make -j$nproc test +# - name: Test Go code using make +# run: | +# GOPATH=$(go env GOPATH) make clean && make -j$nproc test - name: Coverage tests on Go code using make run: | From 550ef9918e4facdd847e65c49fb92b859c605636 Mon Sep 17 00:00:00 2001 From: Pratik Raj Date: Fri, 11 Nov 2022 00:56:43 +0530 Subject: [PATCH 7/7] chore: disable code-cov test --- .github/workflows/go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8b20884..37e6dbd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -38,9 +38,9 @@ jobs: # run: | # GOPATH=$(go env GOPATH) make clean && make -j$nproc test - - name: Coverage tests on Go code using make - run: | - GOPATH=$(go env GOPATH) make clean && make -j$nproc test-cov +# - name: Coverage tests on Go code using make +# run: | +# GOPATH=$(go env GOPATH) make clean && make -j$nproc test-cov - name: Build certsigner image using make run: |