mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-26 21:27:40 -05:00
ci: make setup-go-work a Makefile prereq, remove explicit CI steps (#37268)
This commit is contained in:
@@ -69,8 +69,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Generate mocks
|
||||
run: make mocks
|
||||
- name: Check mocks
|
||||
@@ -94,8 +92,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Run go mod tidy
|
||||
run: make modules-tidy
|
||||
- name: Check modules
|
||||
@@ -106,31 +102,6 @@ jobs:
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
check-go-fix:
|
||||
name: Check go fix
|
||||
needs: go
|
||||
runs-on: ubuntu-22.04
|
||||
container: mattermost/mattermost-build-server:${{ needs.go.outputs.version }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: server
|
||||
steps:
|
||||
- name: Checkout mattermost project
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Run go fix
|
||||
run: go fix ./...
|
||||
- name: Check go fix
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Please run 'go fix ./...' and commit the changes"
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
check-style:
|
||||
name: check-style
|
||||
needs: go
|
||||
@@ -144,8 +115,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Run golangci
|
||||
run: make check-style
|
||||
check-gen-serialized:
|
||||
@@ -161,8 +130,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Run make-gen-serialized
|
||||
run: make gen-serialized
|
||||
- name: Check serialized
|
||||
@@ -186,8 +153,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Run mattermost-vet-api
|
||||
run: make vet-api
|
||||
check-migrations:
|
||||
@@ -263,8 +228,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Generate store layers
|
||||
run: make store-layers
|
||||
- name: Check generated code
|
||||
@@ -301,8 +264,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Generate default roles permissions
|
||||
env:
|
||||
IS_CI: "true"
|
||||
@@ -328,8 +289,6 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Check docs
|
||||
run: |
|
||||
echo "Making sure docs are updated"
|
||||
@@ -517,8 +476,6 @@ jobs:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "npm"
|
||||
cache-dependency-path: "webapp/package-lock.json"
|
||||
- name: Run setup-go-work
|
||||
run: make setup-go-work
|
||||
- name: Build
|
||||
run: |
|
||||
make config-reset
|
||||
|
||||
+8
-4
@@ -1,4 +1,4 @@
|
||||
.PHONY: build package run stop run-client run-server run-node run-haserver stop-haserver stop-client stop-server restart restart-server restart-client restart-haserver start-docker update-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-freebsd build-windows package-prep package-linux package-osx package-windows internal-test-web-client vet run-server-for-web-client-tests diff-config prepackaged-plugins prepackaged-binaries test-server test-server-ee test-server-elasticsearch test-server-opensearch test-server-quick test-server-race test-mmctl-unit test-mmctl-e2e test-mmctl test-mmctl-coverage mmctl-build mmctl-docs new-migration migrations-extract check-migration-changes test-public mocks-public run-server-faketime default-roles-permissions generated
|
||||
.PHONY: build package run stop run-client run-server run-node run-haserver stop-haserver stop-client stop-server restart restart-server restart-client restart-haserver start-docker update-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-freebsd build-windows package-prep package-linux package-osx package-windows internal-test-web-client vet run-server-for-web-client-tests diff-config prepackaged-plugins prepackaged-binaries test-server test-server-ee test-server-elasticsearch test-server-opensearch test-server-quick test-server-race test-mmctl-unit test-mmctl-e2e test-mmctl test-mmctl-coverage mmctl-build mmctl-docs new-migration migrations-extract check-migration-changes test-public mocks-public run-server-faketime default-roles-permissions generated check-go-fix
|
||||
|
||||
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
@@ -404,7 +404,7 @@ mmctl-mocks: setup-go-work ## Creates mocks for mmctl
|
||||
pluginapi: setup-go-work ## Generates api and hooks glue code for plugins
|
||||
cd ./public && $(GO) generate $(GOFLAGS) ./plugin
|
||||
|
||||
default-roles-permissions: start-docker ## Generates default_roles_permissions.js by snapshotting a live database.
|
||||
default-roles-permissions: setup-go-work start-docker ## Generates default_roles_permissions.js by snapshotting a live database.
|
||||
$(GO) run $(GOFLAGS) ./scripts/default_permissions_generator \
|
||||
-out ../e2e-tests/cypress/tests/support/api/default_roles_permissions.js
|
||||
|
||||
@@ -439,7 +439,10 @@ ifneq ($(SKIP_SETUP_GO_WORK),true)
|
||||
fi
|
||||
endif
|
||||
|
||||
check-style: plugin-checker vet golangci-lint ## Runs style/lint checks
|
||||
check-go-fix: setup-go-work ## Check if go fix would modify any files.
|
||||
$(GO) fix -diff ./...
|
||||
|
||||
check-style: plugin-checker vet golangci-lint check-go-fix ## Runs style/lint checks
|
||||
|
||||
gotestsum:
|
||||
$(GO) install gotest.tools/gotestsum@v1.13.0
|
||||
@@ -451,7 +454,7 @@ test-compile: setup-go-work gotestsum ## Compile tests.
|
||||
$(GO) test $(GOFLAGS) -c $$package; \
|
||||
done
|
||||
|
||||
modules-tidy: ## Tidy Go modules
|
||||
modules-tidy: setup-go-work ## Tidy Go modules
|
||||
mv enterprise/external_imports.go enterprise/external_imports.go.orig
|
||||
-$(GO) mod tidy
|
||||
-cd public && $(GO) mod tidy
|
||||
@@ -869,6 +872,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
endif
|
||||
endif
|
||||
|
||||
vet-api: setup-go-work
|
||||
vet-api: export GO := $(GO)
|
||||
vet-api: export GOBIN := $(GOBIN)
|
||||
vet-api: export ROOT := $(ROOT)
|
||||
|
||||
Reference in New Issue
Block a user