-
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.
* Add timeout to Ping function * Fix tests * Add build & test GitHub Action * Update README.md * Add Dockerfile * Add Makefile
- Loading branch information
Showing
6 changed files
with
203 additions
and
28 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,33 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Build | ||
run: go build -o little-stitch -v main.go | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v2.2.4 | ||
with: | ||
name: little-stitch | ||
path: ./little-stitch | ||
if-no-files-found: error | ||
|
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,33 @@ | ||
BINARY_NAME=little-stitch | ||
|
||
build: | ||
GOARCH=amd64 GOOS=darwin go build -ldflags "-s -w" -o ${BINARY_NAME}-darwin-amd64 main.go | ||
GOARCH=arm64 GOOS=darwin go build -ldflags "-s -w" -o ${BINARY_NAME}-darwin-arm64 main.go | ||
|
||
docker/build: | ||
docker run -e GO11MODULES=on -w /build -v "${PWD}:/build" golang:latest make build | ||
|
||
run: | ||
./${BINARY_NAME} | ||
|
||
build_and_run: build run | ||
|
||
clean: | ||
go clean | ||
rm ${BINARY_NAME}-darwin-amd64 | ||
rm ${BINARY_NAME}-darwin-arm64 | ||
|
||
test: | ||
go test ./... | ||
|
||
test_coverage: | ||
go test ./... -coverprofile=coverage.out | ||
|
||
dep: | ||
go mod download | ||
|
||
vet: | ||
go vet | ||
|
||
lint: | ||
golangci-lint run --enable-all |
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
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