-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note: `go mod download` is needed since we don't have vendor, and on a clean system `golangci-lint` won't be able to find the dependent packages. `go mod download` is not required for `go test` since the latter runs it automatically. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ jobs: | |
uses: actions/checkout@v2 | ||
- name: Test | ||
run: make test | ||
- name: Lint | ||
run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
PACKAGES ?= mountinfo mount | ||
BINDIR ?= _build/bin | ||
|
||
.PHONY: all | ||
all: lint test | ||
|
||
.PHONY: test | ||
test: | ||
for p in $(PACKAGES); do \ | ||
(cd $$p && go test -v .); \ | ||
done | ||
|
||
.PHONY: lint | ||
lint: $(BINDIR)/golangci-lint | ||
$(BINDIR)/golangci-lint version | ||
for p in $(PACKAGES); do \ | ||
(cd $$p && go mod download \ | ||
&& ../$(BINDIR)/golangci-lint run); \ | ||
done | ||
|
||
$(BINDIR)/golangci-lint: $(BINDIR) | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BINDIR) v1.24.0 | ||
|
||
$(BINDIR): | ||
mkdir -p $(BINDIR) |