Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use infra-checkers static analysis settings and include known issue to trivyignore #52

Merged
merged 2 commits into from Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/push_pr.yml
Expand Up @@ -19,13 +19,18 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is needed when using golangci-lint-action v3, check this for details.

- uses: newrelic/newrelic-infra-checkers@v1
with:
golangci-lint-config: golangci-lint-limited
- name: Semgrep
uses: returntocorp/semgrep-action@v1
with:
auditOn: push
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
continue-on-error: ${{ github.event_name != 'pull_request' }}
with:
only-new-issues: true
Expand Down
29 changes: 0 additions & 29 deletions .golangci.yml

This file was deleted.

13 changes: 2 additions & 11 deletions Makefile
Expand Up @@ -8,32 +8,23 @@ IMAGE_NAME ?= newrelic/nri-discovery-kubernetes
GOPATH := $(shell go env GOPATH)
GORELEASER_VERSION := v0.168.0
GORELEASER_BIN ?= bin/goreleaser
GOLANGCI_LINT_BIN = golangci-lint

all: build

build: check-version clean validate test compile
build: check-version clean test compile

clean:
@echo "=== $(PROJECT) === [ clean ]: Removing binaries and coverage file..."
@rm -rfv bin
@rm -rfv target

tools: check-version
@which $(GOLANGCI_LINT_BIN) || echo "golangci-lint not found in PATH" >&2 && exit 1

fmt:
@go fmt ./...

deps:
@echo "=== $(PROJECT) === [ deps ]: Installing package dependencies required by the project..."
@go mod download

validate: deps
@echo "=== $(PROJECT) === [ validate ]: Validating source code running golangci-lint..."
@${GOLANGCI_LINT_BIN} --version
@${GOLANGCI_LINT_BIN} run

compile: deps
@echo "=== $(PROJECT) === [ compile ]: Building $(BINARY_NAME)..."
@go build -o bin/$(BINARY_NAME) ./cmd/discovery/
Expand Down Expand Up @@ -71,4 +62,4 @@ endif
include $(CURDIR)/build/ci.mk
include $(CURDIR)/build/release.mk

.PHONY: all fmt build clean tools tools-update deps deps-only validate compile compile-only test check-version tools-golangci-lint docker-build release release/deps release/test docker-release
.PHONY: all fmt build clean tools tools-update deps deps-only compile compile-only test check-version docker-build release release/deps release/test snyk snyk/monitor docker-release