Skip to content

Commit

Permalink
chore(project): build on AppVeyor (#54)
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Feb 17, 2018
1 parent 613a112 commit ed0ed53
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 19 deletions.
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ VENDOR_DIR=vendor
SOURCE_DIR ?= .
SOURCES := $(shell find $(SOURCE_DIR) -path $(SOURCE_DIR)/vendor -prune -o -name '*.go' -print)
COVERPKGS := $(shell go list ./... | grep -v vendor | paste -sd "," -)
COMMIT=$(shell git rev-parse HEAD)
# GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no)
GITUNTRACKEDCHANGES := $(shell git status --porcelain)
ifneq ($(GITUNTRACKEDCHANGES),)
COMMIT := $(COMMIT)-dirty
endif
BUILD_TIME=`date -u '+%Y-%m-%dT%H:%M:%SZ'`



# Pass in build time variables to main
LDFLAGS=-ldflags "-X ${PACKAGE_NAME}/about.Commit=${COMMIT} -X ${PACKAGE_NAME}/about.BuildTime=${BUILD_TIME}"

$(INSTALL_PREFIX):
# Build artifacts dir
Expand All @@ -39,7 +27,6 @@ $(INSTALL_PREFIX):
$(TMP_PATH):
@mkdir -p $(TMP_PATH)


# Call this function with $(call log-info,"Your message")
define log-info =
@echo "INFO: $(1)"
Expand Down
37 changes: 37 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "{build}"

# Source Config

clone_folder: c:\gopath\src\github.com\bytesparadise\libasciidoc

# Build host

environment:
GOPATH: c:\gopath
DEPTESTBYPASS501: 1
GOVERSION: 1.8

init:
- git config --global core.autocrlf input

# Build

install:
- set Path=%PATH%;c:\go\bin;%GOPATH%\bin
- go version
- go env
# Install dep and fetch dependencies
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
# Install ginkgo and gomega to run the tests
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/onsi/gomega

build: false
deploy: false

test_script:
- go build github.com/bytesparadise/libasciidoc
# - for /f "" %%G in ('go list -f {{.Dir}} github.com/bytesparadise/libasciidoc/... ^| find /i /v "/vendor/"') do ( echo %%G & ginkgo -skipPackage log %%G & IF ERRORLEVEL == 1 EXIT 1)
- ginkgo -r . & IF ERRORLEVEL == 1 EXIT 1

2 changes: 1 addition & 1 deletion libasciidoc_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"testing"

_ "github.com/bytesparadise/libasciidoc/test"
_ "github.com/bytesparadise/libasciidoc/log"
)

func TestLibasciidoc(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions test/log_init.go → log/log_init.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test
package log

import (
"flag"
Expand All @@ -9,7 +9,7 @@ import (

// initializes the level for the logger, using the optional '-debug' flag to activate the logs in 'debug' level.
// Other tests must import this 'test' package even if unused, using:
// import _ "github.com/bytesparadise/libasciidoc/test"
// import _ "github.com/bytesparadise/libasciidoc/log"
func init() {
customFormatter := new(log.TextFormatter)
customFormatter.TimestampFormat = "2006-01-02 15:04:05"
Expand Down
2 changes: 1 addition & 1 deletion parser/parser_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"testing"

_ "github.com/bytesparadise/libasciidoc/test"
_ "github.com/bytesparadise/libasciidoc/log"
)

func TestParser(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion renderer/html5/html5_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"testing"

_ "github.com/bytesparadise/libasciidoc/test"
_ "github.com/bytesparadise/libasciidoc/log"
)

func TestHtml5(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion types/types_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"testing"

_ "github.com/bytesparadise/libasciidoc/test"
_ "github.com/bytesparadise/libasciidoc/log"
)

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

0 comments on commit ed0ed53

Please sign in to comment.