-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github workflow, new arg forwarding, cleanup
- Loading branch information
1 parent
7f05752
commit 4b6bab4
Showing
11 changed files
with
286 additions
and
169 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,81 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.x | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install golangci-lint | ||
run: | | ||
go get github.com/golangci/golangci-lint/cmd/golangci-lint | ||
- name: Run linters | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14 | ||
golangci-lint -E bodyclose,misspell,gocyclo,dupl,gofmt,golint,unconvert,goimports,depguard,gocritic,funlen,interfacer run | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.x | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Run Unit tests. | ||
run: go test -v ./... | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.x | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Run coverage | ||
run: go test -v -covermode=count -coverprofile coverage.out ./... | ||
|
||
- name: Upload Coverage report to CodeCov | ||
uses: codecov/codecov-action@v1.0.0 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
file: ./coverage.out | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: [lint, test] | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.x | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: build | ||
run: | | ||
export GO111MODULE=on | ||
GOOS=windows GOARCH=amd64 go build -o bin/ci-test-windows-amd64.exe | ||
GOOS=linux GOARCH=amd64 go build -o bin/ci-test-linux-amd64 | ||
- name: upload artifacts | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: binaries | ||
path: bin/ |
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,27 @@ | ||
name: Release | ||
|
||
on: | ||
create: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
|
||
jobs: | ||
releaser: | ||
name: Release on GitHub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.13.x | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cli | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
) | ||
|
||
// BindArguments replace all "bind:" arguments | ||
func BindArguments(args []string) []string { | ||
result := []string{} | ||
|
||
for _, arg := range args { | ||
if strings.HasPrefix(arg, "bind:") { | ||
result = append(result, os.Getenv(strings.TrimLeft(arg, "bind:"))) | ||
} else { | ||
result = append(result, arg) | ||
} | ||
} | ||
|
||
return result | ||
} |
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 @@ | ||
package cli |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
module github.com/bioapfelsaft/service-wrapper | ||
module github.com/matthiasng/service-wrapper | ||
|
||
go 1.13 | ||
|
||
require golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 | ||
require ( | ||
github.com/akamensky/argparse v0.0.0-20191006154803-1427fe674291 | ||
github.com/bioapfelsaft/service-wrapper v0.0.0-20191201190517-7f0575270b8c | ||
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 | ||
) |
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,2 +1,6 @@ | ||
github.com/akamensky/argparse v0.0.0-20191006154803-1427fe674291 h1:EQ9p1v9+urDzbGQfAcBf9fGuDtYqFNE7YJHZ54TWPTk= | ||
github.com/akamensky/argparse v0.0.0-20191006154803-1427fe674291/go.mod h1:pdh+2piXurh466J9tqIqq39/9GO2Y8nZt6Cxzu18T9A= | ||
github.com/bioapfelsaft/service-wrapper v0.0.0-20191201190517-7f0575270b8c h1:/8y95ksXi6QqXVDVMiEHYiIIpB3WPaIyLjT8bwnE8XA= | ||
github.com/bioapfelsaft/service-wrapper v0.0.0-20191201190517-7f0575270b8c/go.mod h1:otu6HFi3pDmbkyG33JQ9iSowjRYss5nwcZWgFFW8qIg= | ||
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU= | ||
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
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.