Skip to content

Commit

Permalink
Migrate to go modules + Improve GitHub actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Mar 22, 2022
1 parent f5f1821 commit 0d3d503
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 30 deletions.
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2

updates:
- package-ecosystem: "gomod"
directory: "/"
target-branch: "develop"
schedule:
interval: "daily"
timezone: "Europe/London"
time: "03:00"
labels:
- "PR • MAINTENANCE"
assignees:
- "andyone"
reviewers:
- "andyone"

- package-ecosystem: "github-actions"
directory: "/"
target-branch: "develop"
schedule:
interval: "daily"
timezone: "Europe/London"
time: "04:00"
labels:
- "PR • MAINTENANCE"
assignees:
- "andyone"
reviewers:
- "andyone"
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
go: [ '1.16.x', '1.17.x' ]
go: [ '1.17.x', '1.18.x' ]

steps:
- name: Set up Go
Expand All @@ -33,13 +33,13 @@ jobs:
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}

- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
run: make deps-test
run: make deps

- name: Run tests
working-directory: ${{env.SRC_DIR}}
Expand All @@ -57,7 +57,7 @@ jobs:
run: goveralls -service github -coverprofile cover.out

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '14.x'

Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16.x'
go-version: '1.17.x'
id: go

- name: Setup PATH
Expand All @@ -95,7 +95,7 @@ jobs:
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/godoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:

steps:
- name: Trigger GoSumDB and PkgGoDev
uses: essentialkaos/pkgre-godoc-action@v1
uses: essentialkaos/godoc-action@v1
29 changes: 18 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
################################################################################

# This Makefile generated by GoMakeGen 1.3.2 using next command:
# gomakegen .
# This Makefile generated by GoMakeGen 1.5.1 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen

################################################################################

export GO111MODULE=on

.DEFAULT_GOAL := help
.PHONY = fmt vet git-config deps deps-test test help
.PHONY = fmt vet deps deps-test test mod-init mod-update mod-vendor help

################################################################################

git-config: ## Configure git redirects for stable import path services
git config --global http.https://pkg.re.followRedirects true

deps: git-config ## Download dependencies
go get -d -v pkg.re/essentialkaos/ek.v12
deps: mod-update ## Download dependencies

deps-test: git-config ## Download dependencies for tests
go get -d -v pkg.re/essentialkaos/check.v1
deps-test: deps ## Download dependencies for tests

test: ## Run tests
go test -covermode=count ./.

mod-init: ## Initialize new module
go mod init
go mod tidy

mod-update: ## Download modules to local cache
go mod download

mod-vendor: ## Make vendored copy of dependencies
go mod vendor

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;

Expand All @@ -35,6 +42,6 @@ help: ## Show this info
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 1.3.2\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n'

################################################################################
2 changes: 1 addition & 1 deletion beans.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package jmx

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
12 changes: 6 additions & 6 deletions cmd/zabbix-jmx-get/zabbix-jmx-get.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -13,18 +13,18 @@ import (
"strings"
"time"

"pkg.re/essentialkaos/ek.v12/fmtc"
"pkg.re/essentialkaos/ek.v12/options"
"pkg.re/essentialkaos/ek.v12/usage"
"github.com/essentialkaos/ek/fmtc"
"github.com/essentialkaos/ek/options"
"github.com/essentialkaos/ek/usage"

jmx "pkg.re/essentialkaos/go-zabbix-jmx.v1"
jmx "github.com/essentialkaos/go-zabbix-jmx"
)

// ////////////////////////////////////////////////////////////////////////////////// //

const (
APP = "zabbix-jmx-get"
VER = "1.1.0"
VER = "1.1.1"
DESC = "Tool for fetching data from Zabbix Java Gateway"
)

Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package jmx

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package jmx

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion zabbix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package jmx

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
4 changes: 2 additions & 2 deletions zabbix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package jmx

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Copyright (c) 2022 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -14,7 +14,7 @@ import (
"testing"
"time"

. "pkg.re/essentialkaos/check.v1"
. "github.com/essentialkaos/check"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down

0 comments on commit 0d3d503

Please sign in to comment.