Skip to content

Commit

Permalink
Use makefile as entrypoint in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
  • Loading branch information
serathius committed Mar 30, 2023
1 parent 8b93e0e commit f535943
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 28 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,31 @@ jobs:
echo "${TARGET}"
case "${TARGET}" in
linux-amd64)
GOARCH=amd64 PASSES='build' ./scripts/test.sh
GOOS=linux GOARCH=amd64 make build
;;
linux-386)
GOARCH=386 PASSES='build' ./scripts/test.sh
GOOS=linux GOARCH=386 make build
;;
darwin-amd64)
GOARCH=amd64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=darwin GOARCH=amd64 make build
;;
darwin-arm64)
GOARCH=arm64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=darwin GOARCH=arm64 make build
;;
windows-amd64)
GOARCH=amd64 GOOS=windows GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=windows GOARCH=amd64 make build
;;
linux-arm)
GOARCH=arm GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=linux GOARCH=arm make build
;;
linux-arm64)
GOARCH=arm64 GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=linux GOARCH=arm64 make build
;;
linux-ppc64le)
GOARCH=ppc64le GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=linux GOARCH=ppc64le make build
;;
linux-s390x)
GOARCH=s390x GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
GOOS=linux GOARCH=s390x make build
;;
*)
echo "Failed to find target"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
echo "${TARGET}"
case "${TARGET}" in
linux-arm64-e2e)
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh
GOOS=linux GOARCH=arm64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release
;;
*)
echo "Failed to find target"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh
GOOS=linux GOARCH=amd64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release
;;
linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh
GOOS=linux GOARCH=386 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e
;;
*)
echo "Failed to find target"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/grpcproxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-grpcproxy-integration)
PASSES='build grpcproxy_integration' CPU='4' COVER='false' RACE='true' ./scripts/test.sh
GOOS=linux GOARCH=amd64 CPU=4 RACE=true make test-grpcproxy-integration
;;
linux-amd64-grpcproxy-e2e)
PASSES='build grpcproxy_e2e' CPU='4' COVER='false' RACE='true' ./scripts/test.sh
GOOS=linux GOARCH=amd64 CPU=4 RACE=true make test-grpcproxy-e2e
;;
*)
echo "Failed to find target"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-arm64-integration-1-cpu)
GOARCH=arm64 CPU=1 PASSES='integration' RACE='false' ./scripts/test.sh
GOOS=linux GOARCH=arm64 CPU=1 make test-integration
;;
linux-arm64-integration-2-cpu)
GOARCH=arm64 CPU=2 PASSES='integration' RACE='false' ./scripts/test.sh
GOOS=linux GOARCH=arm64 CPU=2 make test-integration
;;
linux-arm64-integration-4-cpu)
GOARCH=arm64 CPU=4 PASSES='integration' RACE='false' ./scripts/test.sh
GOOS=linux GOARCH=arm64 CPU=4 make test-integration
;;
linux-arm64-unit-4-cpu-race)
GOARCH=arm64 PASSES='unit' RACE='true' CPU='4' ./scripts/test.sh -p=2
GOOS=linux GOARCH=arm64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit
;;
*)
echo "Failed to find target"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ jobs:
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./scripts/test.sh
GOOS=linux GOARCH=amd64 CPU=1 make test-integration
;;
linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./scripts/test.sh
GOOS=linux GOARCH=amd64 CPU=2 make test-integration
;;
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./scripts/test.sh
GOOS=linux GOARCH=amd64 CPU=4 make test-integration
;;
linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./scripts/test.sh -p=2
GOOS=linux GOARCH=amd64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit
;;
linux-386-unit-1-cpu)
GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./scripts/test.sh -p=4
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
;;
*)
echo "Failed to find target"
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
.PHONY: build
build:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v" ./scripts/build.sh
./bin/etcd --version
./bin/etcdctl version
./bin/etcdutl version
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: tools
tools:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v" ./scripts/build_tools.sh
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build_tools.sh

# Tests

Expand All @@ -29,6 +26,14 @@ test-integration:
test-e2e: build
PASSES="e2e" ./scripts/test.sh $(GO_TEST_FLAGS)

.PHONY: test-grpcproxy-integration
test-grpcproxy-integration:
PASSES="grpcproxy_integration" ./scripts/test.sh $(GO_TEST_FLAGS)

.PHONY: test-grpcproxy-e2e
test-grpcproxy-e2e: build
PASSES="grpcproxy_e2e" ./scripts/test.sh $(GO_TEST_FLAGS)

.PHONY: test-e2e-release
test-e2e-release: build
PASSES="release e2e" ./scripts/test.sh $(GO_TEST_FLAGS)
Expand Down

0 comments on commit f535943

Please sign in to comment.