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