diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7540f99..1aae2f9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,8 +4,13 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + +permissions: + contents: read + pull-requests: read + jobs: - build: + prebuild: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,4 +22,25 @@ jobs: version: v1.58 - run: make codegen-verify - run: make test - - run: make build + - uses: actions/upload-artifact@v4 + with: + name: build + path: ${{ github.workspace }} + + controller: + needs: prebuild + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: build + - run: make controller + + plugin: + needs: prebuild + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: build + - run: make plugin diff --git a/Makefile b/Makefile index 3ee1847..d5db639 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,12 @@ OPENAPI_GO_PKG := github.com/ihcsim/k8s-dra/pkg/openapi BOILERPLATE_FILE := hack/boilerplate.go.txt -build: controller plugin +build: test controller plugin -controller: tidy lint +controller: GOOS=$(GOOS) GOARCH=$(GOARCH) go build ./cmd/controller -plugin: tidy lint +plugin: GOOS=$(GOOS) GOARCH=$(GOARCH) go build ./cmd/plugin test: tidy lint