[VOL-5026] - Build and (pre-) deploy repo:voltha-go
Makefile
--------
o Refactor test and mod-* targets per voltha-openolt-adatpter/Makefile.
o Logic moved into makefiles/analysis/{coverage,sca}.mk
o Inline ( set -euo pipefail && cmd | tee log) in test-coverage.
o Improve error handling, "cmd | tee" will silently mask shell exit status.
o make test failing locally (docker image: cpu profile acces denied).
o Local problem, send a job through jenkins for accurate status.
makefiles/
----------
o Copy in library makefiles
o Esp docker/include.mk
compose/*/*.yaml
----------------
o Update copyright notice
db/*/*.go
rw_core/*/*.go
--------------
o Run gofmt -s -w on source to fix latent linting problmes that fail jobs.
Change-Id: If7cd349822edd0e604ac4daf27d315f528c6bcf6
diff --git a/makefiles/analysis/sca.mk b/makefiles/analysis/sca.mk
new file mode 100644
index 0000000..19d7f91
--- /dev/null
+++ b/makefiles/analysis/sca.mk
@@ -0,0 +1,52 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2016-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+sca:
+ $(call banner-enter,$@)
+
+ @$(RM) -r ./sca-report
+ @mkdir -p ./sca-report
+ @echo "Running static code analysis..."
+ @${GOLANGCI_LINT} run --deadline=6m --out-format junit-xml ./... \
+ | tee ./sca-report/sca-report.xml
+ @echo ""
+ @echo "Static code analysis OK"
+
+ $(call banner-leave,$@)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+clean-sca :
+ @$(RM) -r ./sca-report
+ $(RM) ./sca-report/sca-report.xml
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+clean :: clean-sca
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help ::
+ @echo ' sca Runs static code analysis with the golangci-lint tool'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]