Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

migrate to github actions and update deps #64

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Unit tests

on:
pull_request:
branches: [ master ]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [1.20.x, 1.21.x, 1.22.x]

steps:
- uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install Consul for testing
run: |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install consul

- name: Test
run: make deps && make test
env:
CGO_ENABLED: '0'
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine AS builder
FROM golang:1.19-alpine AS builder

RUN apk --no-cache add git make

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ build:
deps:
go mod download

update-deps:
go get -t -u ./...
go mod tidy -compat=1.17

test:
go test ./... $(TESTARGS) -timeout=30s -parallel=4
go vet ./...
Expand All @@ -32,4 +36,4 @@ package: xcompile
package-clean:
-@rm -rf build/

.PHONY: all deps updatedeps build test xcompile package package-clean
.PHONY: all build deps update-deps test xcompile package package-clean
2 changes: 1 addition & 1 deletion commands/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestMain(m *testing.M) {
flag.Parse()

// create a test Consul server
consulTestServer, err := testutil.NewTestServerConfig(func(c *testutil.TestServerConfig) {
consulTestServer, err := testutil.NewTestServerConfigT(&testing.T{}, func(c *testutil.TestServerConfig) {
c.Connect = nil

if !consulServerOutputEnabled {
Expand Down
48 changes: 31 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
module github.com/mantl/consul-cli

go 1.13
go 1.17

require (
github.com/armon/go-metrics v0.3.2 // indirect
github.com/hashicorp/consul/api v1.4.0
github.com/hashicorp/consul/sdk v0.4.0
github.com/hashicorp/go-immutable-radix v1.1.0 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/consul/api v1.28.3
github.com/hashicorp/consul/sdk v0.16.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/memberlist v0.1.7 // indirect
github.com/hashicorp/serf v0.8.5 // indirect
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
)

require (
github.com/armon/go-metrics v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/hashicorp/consul/proto-public v0.6.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/cobra v0.0.6
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.5.0
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 // indirect
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa // indirect
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/sys v0.20.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading