-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow JSON formatter to have json compliant extra vars (#3)
- Loading branch information
Showing
6 changed files
with
232 additions
and
44 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.14" | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run lint | ||
run: | | ||
make lint | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.14" | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run unit tests | ||
run: | | ||
make test-unit |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright 2021 The Nuclio Authors. | ||
# | ||
# 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. | ||
|
||
|
||
.PHONY: fmt | ||
fmt: ## Code formatting | ||
gofmt -s -w . | ||
|
||
.PHONY: lint | ||
lint: modules ## Code linting | ||
@echo Installing linters... | ||
@test -e $(GOPATH)/bin/impi || \ | ||
(mkdir -p $(GOPATH)/bin && \ | ||
curl -s https://api.github.com/repos/pavius/impi/releases/latest \ | ||
| grep -i "browser_download_url.*impi.*$(OS_NAME)" \ | ||
| cut -d : -f 2,3 \ | ||
| tr -d \" \ | ||
| wget -O $(GOPATH)/bin/impi -qi - \ | ||
&& chmod +x $(GOPATH)/bin/impi) | ||
|
||
@test -e $(GOPATH)/bin/golangci-lint || \ | ||
(curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.36.0) | ||
|
||
@echo Verifying imports... | ||
$(GOPATH)/bin/impi \ | ||
--local github.com/nuclio/zap/ \ | ||
--scheme stdLocalThirdParty \ | ||
./... | ||
|
||
@echo Linting... | ||
$(GOPATH)/bin/golangci-lint run -v | ||
@echo Done. | ||
|
||
|
||
.PHONY: modules | ||
modules: ensure-gopath ## Download go module packages | ||
@echo Getting go modules | ||
@go mod download | ||
|
||
.PHONY: ensure-gopath | ||
ensure-gopath: ## Ensure GOPATH env is set | ||
ifndef GOPATH | ||
$(error GOPATH must be set) | ||
endif | ||
|
||
|
||
.PHONY: test-unit | ||
test-unit: ## Run unit tests | ||
go test -v ./... -short | ||
|
||
.PHONY: help | ||
help: ## Display available commands | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
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 +1,3 @@ | ||
# zap | ||
|
||
A Nuclio.Logger wrapper for [zap](https://github.com/uber-go/zap) |
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
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
Oops, something went wrong.