diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..71da032 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/.gitignore b/.gitignore index 9542eff..0141765 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -vendor/ +bin/ coverage.out github_deploy_key github_deploy_key.pub -debug.test \ No newline at end of file +debug.test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 76668ea..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -sudo: required - -language: go - -go: - - 1.9 - -branches: - only: - - master - -install: - - wget https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz -O /tmp/glide-v0.12.3-linux-amd64.tar.gz - - tar -xvf /tmp/glide-v0.12.3-linux-amd64.tar.gz - - export PATH=$PATH:$PWD/linux-amd64/ - - make install-deps - -script: - - make test-coverage - - make travis-release - -env: - global: - - ENCRYPTION_LABEL: "e53e59254cc7" - -after_success: - - make send-codecov-ci diff --git a/.travis/release.sh b/.travis/release.sh deleted file mode 100755 index 6b41475..0000000 --- a/.travis/release.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -set -e # Exit with nonzero exit code if anything fails - -# Pull requests and commits to other branches shouldn't try to deploy -if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then - exit 0 -fi - -# Save some useful information -REPO=`git config remote.origin.url` -SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} -git remote set-url origin "$SSH_REPO" - -git config user.name "Travis CI" -git config user.email "travis@travis-ci.org" - -# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc -ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" -ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" -ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} -ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} -openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in github_deploy_key.enc -out github_deploy_key -d -chmod 600 github_deploy_key -eval `ssh-agent -s` -ssh-add github_deploy_key - -# Now that we're all set up, we can release. -make release \ No newline at end of file diff --git a/Makefile b/Makefile index d0c07f4..bdf3a09 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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) \ No newline at end of file diff --git a/github_deploy_key.enc b/github_deploy_key.enc deleted file mode 100644 index f956af5..0000000 Binary files a/github_deploy_key.enc and /dev/null differ diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 0ac1fed..0000000 --- a/glide.lock +++ /dev/null @@ -1,16 +0,0 @@ -hash: 973b39e878a13aa9849be0ed2bc1d0fe9c7a88faebabfb2b6a5adfb1bf6cfd78 -updated: 2016-11-27T11:18:03.752489636-02:00 -imports: [] -testImports: -- name: github.com/davecgh/go-spew - version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 - subpackages: - - spew -- name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d - subpackages: - - difflib -- name: github.com/stretchr/testify - version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 - subpackages: - - assert diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 5fec95a..0000000 --- a/glide.yaml +++ /dev/null @@ -1,7 +0,0 @@ -package: github.com/franciscocpg/reflectme -import: [] -testImport: -- package: github.com/stretchr/testify - version: ^1.1.4 - subpackages: - - assert diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b505964 --- /dev/null +++ b/go.mod @@ -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 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..6a56e69 --- /dev/null +++ b/go.sum @@ -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=