Skip to content

Commit

Permalink
Update CI to do parallel builds
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Sim <[email protected]>
  • Loading branch information
ihcsim committed May 26, 2024
1 parent 1421a04 commit 2ba570b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,5 +21,36 @@ jobs:
with:
version: v1.58
- run: make codegen-verify
- run: make tidy
- run: make lint
- uses: actions/upload-artifact@v4
with:
name: build
path: ${{ github.workspace }}

test:
needs: prebuild
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: build
- run: make test
- run: make build

controller:
needs: [prebuild, test]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: build
- run: make controller

plugin:
needs: [prebuild, test]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: build
- run: make plugin
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ OPENAPI_GO_PKG := github.com/ihcsim/k8s-dra/pkg/openapi

BOILERPLATE_FILE := hack/boilerplate.go.txt

build: controller plugin
all: tidy lint 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
test:
GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./...

tidy:
Expand Down

0 comments on commit 2ba570b

Please sign in to comment.