Skip to content

Commit

Permalink
Fixed CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
apognu committed Mar 23, 2020
1 parent 08c62e5 commit bbf462b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
26 changes: 22 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
sudo: required
language: go

go:
- 1.x

os:
- linux

env:
global:
secure: emnRsBTHNNiMUzB/sXtLlLxc1wStTFjl1eCxCPgp/SIHjVFDYrjdyaTzQDhzdpfxVb1xrLTp7ND5gfc3v4/7Oj5BCRtBn8p/HxMdIogCy2ciZa13khFJwDCMfOwxesHzhxjCyVdJIsu9RuR8dLfgy/0MT120icwk/G/ipKzQgpMrw+YTe59jXsRPOUDxas+foka02vqJtbJyHj1hh4kqnK2DfTAu4puSmmKdXV1UvLhUwDqXoeDtp5I9WoVmSDQBVcDsaESdjD4+TcMOVd3jJM8NsP4kdW7Oa5cHd+0vJtAeJtzjB8346knEiuqa98FahbMmy4dL15BqPnyT8BrSf3ZqoMTrcbeVridpT+qowxcqzaprU46bWks6fi2UYJnw1AY6IeADMoiSks1f6IoGCaDaFbsLr3MiUDQHxv2UZfmksNvvpyU0R7EhW5K8876Ik3DLXOMP46mJtN91aw7LRGwwUU8fJE9dftO0lTbsiCPtWKX+gHdlRdz9iudwmNRK9w6r2R7IubIahc0o2tOnk8Lr6ZzF1RXng6uVnKvChMLwSqr0Uvl2g+2gNyAwy0zA7aubH1kHpkIx3Y9wgbRm1EvlsxhLbAZZ+aibggFOOiVwIASBmoXfqnh20GY2TJcSB7dm03MgTRlQ291QvSXvMpTD1Vto7prRvXM48b2HUYg=

before_install:
- sudo add-apt-repository -y ppa:wireguard/wireguard
- sudo apt-get -yq update
- sudo apt-get -yq install linux-headers-$(uname -r) wireguard-dkms
- go get github.com/golang/dep/cmd/dep
- go get golang.org/x/lint/golint
- go get github.com/mattn/goveralls
install:
- dep ensure -v

script:
- go build .
- go get
- go vet ./...
- golint -set_exit_status $(go list ./... | grep -v vendor/)
- sudo env "PATH=$PATH" go test -v -cover -coverprofile cover.out ./...
- sudo env "PATH=$PATH" goveralls -service=travis-ci -repotoken=$COVERALLS_TOKEN -coverprofile=cover.out
- go build .

before_deploy:
- RELEASE_MESSAGE="$(git tag -ln --format '%(subject)' $TRAVIS_TAG)"

deploy:
provider: releases
name: $TRAVIS_TAG
body: $RELEASE_MESSAGE
file: wgctl
overwrite: true
skip_cleanup: true
on:
tags: true
api_key:
secure: I+ZBv7vBWmVphrB2HNpV+ksMoJNbQ0W9rhy+G9m3ajDa1wPm/t+XZ1G4Kgr7Kh3zHEt3slbYK5mRbidYXwVunVUt4edH62DxgD9Ofz6s7mnRhBiNCBn07rGVYVuebeX//lq2+2m2kj+zJ1nFE5/PJDLqWkoMzOsT5R615tKOHwlbnk9L0C0J2UpcZREsfEBCeS9Nvss2Lp2k1CCWnLA0yZOf0zTrCN38KB582ucht6G2+58nu3Ewmp7JH/2mMAcf5SZ3Eho76Hqmm9jWyvQXJ5XxvO4zz+6QcxPX+uU8J5kcl35Ij+591aLD3yPfxMVmXK5cNkh0vNQols36QZ0jD2lCjlin+jfNPpDsGk4Xa2+DhompCddv4/aOYV6rStSYopoOYau+9eXm+M1JRu+n7J5EGsF1qGdpeVcPATu54MfqS8EvdoMp6rP/zVyKer/VM2rUCtUKbxmBlmgKZT+KCsvk++2QiKbOnl1zShwXwyguG7cOTaUdxiUZqNcUv/o40joPHZ3QoG/LB8IDLv1okgDh7r3m3bUNBYG6tBYvHABOtYimT7vea+d3XQO+5wYStxW7ACFTZmbHuzEcaRjzHQZL4ZT2mVgxk0EsGy0GiAP+U7c6jBGZYInFK25TDNCNXpSRyAVswt4/hoq6RARrOnIGHeLHbKQQwKXbstJ75kU=
8 changes: 5 additions & 3 deletions lib/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,17 @@ func Test_ParseConfigNoExistFile(t *testing.T) {
}

func Test_ParseConfig(t *testing.T) {
ioutil.WriteFile("/etc/wireguard/existingconfig.yml", []byte(fullConfigYAML), 0400)
os.Setenv("WGCTL_CONFIG_PATH", "/tmp")
ioutil.WriteFile("/tmp/existingconfig.yml", []byte(fullConfigYAML), 0400)

_, err := ParseConfig("existingconfig")
assert.Nil(t, err)

_, err = ParseConfig("/etc/wireguard/existingconfig.yml")
_, err = ParseConfig("/tmp/existingconfig.yml")
assert.Nil(t, err)

os.Remove("/etc/wireguard/existingconfig.yml")
os.Unsetenv("WGCTL_CONFIG_PATH")
os.Remove("/tmp/existingconfig.yml")
}

func Test_GetPeer(t *testing.T) {
Expand Down

0 comments on commit bbf462b

Please sign in to comment.