From e2bd28b0b8d4528a223410ddbba4233815b79bb4 Mon Sep 17 00:00:00 2001 From: Adi Sosnovich <82078442+adisos@users.noreply.github.com> Date: Sun, 2 Mar 2025 15:06:02 +0200 Subject: [PATCH] add operator-build automation for ci (#288) * add operator-build automation for ci Signed-off-by: adisos --- .github/workflows/operator-build.yml | 25 +++++++++++++++++++++++++ Makefile | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/operator-build.yml diff --git a/.github/workflows/operator-build.yml b/.github/workflows/operator-build.yml new file mode 100644 index 00000000..90065827 --- /dev/null +++ b/.github/workflows/operator-build.yml @@ -0,0 +1,25 @@ +name: build-operator + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: Set up Go + uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 + with: + go-version-file: ./operator/go.mod + + - name: Build + run: make build-operator + diff --git a/Makefile b/Makefile index 9c7450e8..1ddff1e0 100644 --- a/Makefile +++ b/Makefile @@ -51,4 +51,7 @@ generate_sdk: pkg/model/generated/nsx_sdk.go nsx-analyzer-image: docker build -t $(IMAGE_REGISTRY)/$(NSX_ANALYZER_IMAGE):$(NSX_ANALYZER_TAG) . +build-operator: + cd operator; go build -o bin/manager cmd/main.go + .DEFAULT_GOAL := build