Skip to content

Commit

Permalink
use go mod (#14)
Browse files Browse the repository at this point in the history
* Use go mod and github actions

* Fix go mod

* Fix gocov
  • Loading branch information
franciscocpg authored Mar 23, 2023
1 parent f06ae3c commit bd58b61
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 111 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Main

on:
push:
branches: [ "master" ]
pull_request:

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Test
run: make test-coverage

- name: Send coverage to codecov
uses: codecov/codecov-action@v3
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vendor/
bin/
coverage.out
github_deploy_key
github_deploy_key.pub
debug.test
debug.test
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .travis/release.sh

This file was deleted.

38 changes: 7 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
SHELL := /bin/bash
COVERAGE_FILE = coverage.out
COVERAGE_FILE = coverage.out
export GOBIN := $(PWD)/bin

up-deps:
glide up

install-deps:
glide i
gocov := $(GOBIN)/gocov
$(gocov):
@go install github.com/axw/gocov/gocov@latest

test:
go test -v
Expand All @@ -16,30 +14,8 @@ test-coverage:
coverage-html: test-coverage
go tool cover -html=${COVERAGE_FILE}

coverage-missing: gocov test-coverage
gocov convert ${COVERAGE_FILE} | gocov annotate - | grep MISS

send-codecov-ci:
bash <(curl -s https://codecov.io/bash)
coverage-missing: $(gocov) test-coverage
$(gocov) convert ${COVERAGE_FILE} | $(gocov) annotate - | grep MISS

send-codecov-local:
bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN}

gocov:
gocov=$(shell which gocov)
[ ! -z $${gocov} ] || go get -v github.com/axw/gocov/gocov

next-version: git-semver
git semver next

release: next-version
git push --tags

travis-release:
.travis/release.sh

git-semver:
git semver 1>/dev/null 2>&1 || (git clone https://github.com/markchalloner/git-semver.git /tmp/git-semver && cd /tmp/git-semver && git checkout $( \
git tag | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+$' | \
sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -n 1 \
) && sudo ./install.sh)
Binary file removed github_deploy_key.enc
Binary file not shown.
16 changes: 0 additions & 16 deletions glide.lock

This file was deleted.

7 changes: 0 additions & 7 deletions glide.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/franciscocpg/reflectme

go 1.20

require github.com/stretchr/testify v1.8.2

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit bd58b61

Please sign in to comment.