MM-27735: Do not build test and other tools in CI (#15238)
Our codebase uses main_test.go files to control tests at a package level. However, the problem with that is when we use ./... to build the codebase, those binaries also get built. This is unnecessary and creates further delays in the pipeline. All we need to build are only mattermost and platform binaries in CI. The rest are dependant on the developer. In my dev environment, this reduces the build times from 13 seconds to 4 seconds. https://mattermost.atlassian.net/browse/MM-27735
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
220d39d09b
Коммит
ac26555cdb
@@ -163,7 +163,7 @@ jobs:
|
||||
cd mattermost-server
|
||||
make config-reset
|
||||
make check-style BUILD_NUMBER='${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}' MM_NO_ENTERPRISE_LINT=true MM_VET_OPENSPEC_PATH='${PWD}/../mattermost-api-reference/v4/html/static/mattermost-openapi-v4.yaml'
|
||||
make build BUILD_NUMBER='${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}'
|
||||
make build-cmd BUILD_NUMBER='${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}'
|
||||
make package BUILD_NUMBER='${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}'
|
||||
curl -sL https://sentry.io/get-cli/ | bash
|
||||
export VERSION=$(sentry-cli releases propose-version)
|
||||
|
||||
@@ -28,8 +28,37 @@ else
|
||||
env GOOS=windows GOARCH=amd64 $(GO) build -o $(GOBIN)/windows_amd64 $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./...
|
||||
endif
|
||||
|
||||
build-cmd-linux:
|
||||
@echo Build Linux amd64
|
||||
ifeq ($(BUILDER_GOOS_GOARCH),"linux_amd64")
|
||||
env GOOS=linux GOARCH=amd64 $(GO) build -o $(GOBIN) $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./cmd/...
|
||||
else
|
||||
mkdir -p $(GOBIN)/linux_amd64
|
||||
env GOOS=linux GOARCH=amd64 $(GO) build -o $(GOBIN)/linux_amd64 $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./cmd/...
|
||||
endif
|
||||
|
||||
build-cmd-osx:
|
||||
@echo Build OSX amd64
|
||||
ifeq ($(BUILDER_GOOS_GOARCH),"darwin_amd64")
|
||||
env GOOS=darwin GOARCH=amd64 $(GO) build -o $(GOBIN) $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./cmd/...
|
||||
else
|
||||
mkdir -p $(GOBIN)/darwin_amd64
|
||||
env GOOS=darwin GOARCH=amd64 $(GO) build -o $(GOBIN)/darwin_amd64 $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./cmd/...
|
||||
endif
|
||||
|
||||
build-cmd-windows:
|
||||
@echo Build Windows amd64
|
||||
ifeq ($(BUILDER_GOOS_GOARCH),"windows_amd64")
|
||||
env GOOS=windows GOARCH=amd64 $(GO) build -o $(GOBIN) $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./cmd/...
|
||||
else
|
||||
mkdir -p $(GOBIN)/windows_amd64
|
||||
env GOOS=windows GOARCH=amd64 $(GO) build -o $(GOBIN)/windows_amd64 $(GOFLAGS) -trimpath -ldflags '$(LDFLAGS)' ./cmd/...
|
||||
endif
|
||||
|
||||
build: build-linux build-windows build-osx
|
||||
|
||||
build-cmd: build-cmd-linux build-cmd-windows build-cmd-osx
|
||||
|
||||
build-client:
|
||||
@echo Building mattermost web app
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user