Matteo Scandolo | 9061e43 | 2022-05-10 13:56:29 -0700 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: ${today.year}-present Intel Corporation |
| 2 | # |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | # set default shell |
| 6 | SHELL = bash -e -o pipefail |
| 7 | |
| 8 | # Variables |
| 9 | VERSION ?= $(shell cat ./VERSION) |
| 10 | |
| 11 | # tool containers |
| 12 | VOLTHA_TOOLS_VERSION ?= 2.4.0 |
| 13 | |
| 14 | GO = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golang go |
| 15 | GO_JUNIT_REPORT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app -i voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-go-junit-report go-junit-report |
| 16 | GOCOVER_COBERTURA = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app/src/github.com/opencord/bbsim-sadis-server -i voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-gocover-cobertura gocover-cobertura |
| 17 | GOLANGCI_LINT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golangci-lint golangci-lint |
| 18 | HADOLINT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-hadolint hadolint |
| 19 | |
| 20 | ## lint and unit tests |
| 21 | |
| 22 | lint: |
| 23 | @echo "Add lint command for Dockerfile and go modules, see https://github.com/opencord/bbsim-sadis-server/blob/master/Makefile#L83-L103" |
| 24 | |
| 25 | sca: |
| 26 | @echo "Add static code analysis command for Go code, see https://github.com/opencord/bbsim-sadis-server/blob/master/Makefile#L105-L111" |
| 27 | |
| 28 | test: |
| 29 | @echo "Add unit test command for Go code, see https://github.com/opencord/bbsim-sadis-server/blob/master/Makefile#L113-L119" |