Skip to content

Commit d39eb39

Browse files
authored
Refactor CI workflow (#3)
* Refactor CI workflow Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp> --------- Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
1 parent 641381e commit d39eb39

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,38 @@ on:
44
push:
55
branches:
66
- 'main'
7-
env:
8-
go-version: "1.23"
97
jobs:
8+
build:
9+
name: Build binaries
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: "go.mod"
16+
- run: make lint
17+
- run: make build
1018
test:
1119
name: Small tests
1220
runs-on: ubuntu-24.04
1321
steps:
1422
- uses: actions/checkout@v4
1523
- uses: actions/setup-go@v5
1624
with:
17-
go-version: ${{ env.go-version }}
25+
go-version-file: "go.mod"
26+
- run: make test
27+
- run: make check-generate
28+
e2e:
29+
name: End-to-end tests
30+
runs-on: ubuntu-24.04
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-go@v5
34+
with:
35+
go-version-file: "go.mod"
36+
- run: make setup
37+
working-directory: test/e2e
38+
- run: make start
39+
working-directory: test/e2e
1840
- run: make test
41+
working-directory: test/e2e

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
2727
.PHONY: generate
2828
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
2929
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
30+
31+
.PHONY: check-generate
32+
check-generate:
33+
$(MAKE) manifests generate k8s-client-gen
34+
git diff --exit-code --name-only
3035

3136
# refer to https://github.com/statnett/image-scanner-operator/pull/668/files
3237
GO_MODULE = $(shell go list -m)

0 commit comments

Comments
 (0)