Migrate to go modules + Improve GitHub actions workflows

main
Anton Novojilov 3 years ago
parent bca9d0b891
commit 2f803e2fae

@ -17,7 +17,7 @@ jobs:
strategy: strategy:
matrix: matrix:
go: [ '1.16.x', '1.17.x' ] go: [ '1.17.x', '1.18.x' ]
steps: steps:
- name: Set up Go - name: Set up Go
@ -32,7 +32,7 @@ jobs:
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: ${{env.SRC_DIR}} path: ${{env.SRC_DIR}}
@ -60,7 +60,7 @@ jobs:
run: goveralls -service github -coverprofile cover.out run: goveralls -service github -coverprofile cover.out
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v3
with: with:
node-version: '14.x' node-version: '14.x'
@ -88,7 +88,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.16.x' go-version: '1.17.x'
id: go id: go
- name: Setup PATH - name: Setup PATH
@ -98,7 +98,7 @@ jobs:
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: ${{env.SRC_DIR}} path: ${{env.SRC_DIR}}

@ -10,4 +10,4 @@ jobs:
steps: steps:
- name: Trigger GoSumDB and PkgGoDev - name: Trigger GoSumDB and PkgGoDev
uses: essentialkaos/pkgre-godoc-action@v1 uses: essentialkaos/godoc-action@v1

@ -1,30 +1,36 @@
################################################################################ ################################################################################
# This Makefile generated by GoMakeGen 1.3.2 using next command: # This Makefile generated by GoMakeGen 1.5.1 using next command:
# gomakegen . # gomakegen --mod .
# #
# More info: https://kaos.sh/gomakegen # More info: https://kaos.sh/gomakegen
################################################################################ ################################################################################
export GO111MODULE=on
.DEFAULT_GOAL := help .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 deps: mod-update ## Download dependencies
git config --global http.https://pkg.re.followRedirects true
deps: git-config ## Download dependencies
go get -d -v github.com/golang/freetype
go get -d -v golang.org/x/image/font
deps-test: git-config ## Download dependencies for tests deps-test: deps ## Download dependencies for tests
go get -d -v pkg.re/essentialkaos/check.v1
test: ## Run tests test: ## Run tests
go test -covermode=count . 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 fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \; find . -name "*.go" -exec gofmt -s -w {} \;
@ -36,6 +42,6 @@ help: ## Show this info
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}' | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
@echo -e '' @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'
################################################################################ ################################################################################

@ -1,7 +1,7 @@
<p align="center"><a href="#readme"><img src="https://gh.kaos.st/go-badge.svg"/></a></p> <p align="center"><a href="#readme"><img src="https://gh.kaos.st/go-badge.svg"/></a></p>
<p align="center"> <p align="center">
<a href="https://kaos.sh/g/go-badge.v1"><img src="https://gh.kaos.st/godoc.svg" alt="PkgGoDev" /></a> <a href="https://kaos.sh/g/go-badge"><img src="https://gh.kaos.st/godoc.svg" alt="PkgGoDev" /></a>
<a href="https://kaos.sh/w/go-badge/ci"><img src="https://kaos.sh/w/go-badge/ci.svg" alt="GitHub Actions CI Status" /></a> <a href="https://kaos.sh/w/go-badge/ci"><img src="https://kaos.sh/w/go-badge/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/go-badge"><img src="https://kaos.sh/r/go-badge.svg" alt="GoReportCard" /></a> <a href="https://kaos.sh/r/go-badge"><img src="https://kaos.sh/r/go-badge.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/c/go-badge"><img src="https://kaos.sh/c/go-badge.svg" alt="Coverage Status" /></a> <a href="https://kaos.sh/c/go-badge"><img src="https://kaos.sh/c/go-badge.svg" alt="Coverage Status" /></a>
@ -18,16 +18,16 @@
### Installation ### Installation
Make sure you have a working Go 1.16+ workspace (_[instructions](https://golang.org/doc/install)_), then: Make sure you have a working Go 1.17+ workspace (_[instructions](https://golang.org/doc/install)_), then:
````bash ````bash
go get -d pkg.re/essentialkaos/go-badge.v1 go get -d github.com/essentialkaos/go-badge
```` ````
For update to latest stable release, do: For update to latest stable release, do:
```bash ```bash
go get -d -u pkg.re/essentialkaos/go-badge.v1 go get -d -u github.com/essentialkaos/go-badge
``` ```
### Usage example ### Usage example
@ -39,7 +39,7 @@ package main
import ( import (
"fmt" "fmt"
"pkg.re/essentialkaos/go-badge.v1" "github.com/essentialkaos/go-badge"
) )
// ////////////////////////////////////////////////////////////////////////// // // ////////////////////////////////////////////////////////////////////////// //

@ -11,7 +11,7 @@ import (
"io/ioutil" "io/ioutil"
"testing" "testing"
. "pkg.re/essentialkaos/check.v1" . "github.com/essentialkaos/check"
) )
// ////////////////////////////////////////////////////////////////////////////////// // // ////////////////////////////////////////////////////////////////////////////////// //

Loading…
Cancel
Save