Skip to content

Commit

Permalink
Update ci (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
briandowns committed Feb 13, 2022
1 parent 16b2c08 commit 561dc95
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,27 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.17
parallelism: 2
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: make test
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- store_artifacts:
path: /tmp/test-results
destination: raw-test-output

- store_test_results:
path: /tmp/test-results
workflows:
version: 2
build-workflow:
jobs:
- build
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# Spinner

[![GoDoc](https://godoc.org/github.com/briandowns/spinner?status.svg)](https://godoc.org/github.com/briandowns/spinner) [![Build Status](https://travis-ci.org/briandowns/spinner.svg?branch=master)](https://travis-ci.org/briandowns/spinner)
[![GoDoc](https://godoc.org/github.com/briandowns/spinner?status.svg)](https://godoc.org/github.com/briandowns/spinner) [![CircleCI](https://circleci.com/gh/briandowns/spinner.svg?style=svg)](https://circleci.com/gh/briandowns/spinner)

spinner is a simple package to add a spinner / progress indicator to any terminal application. Examples can be found below as well as full examples in the examples directory.

Expand Down
11 changes: 11 additions & 0 deletions spinner_test.go
Expand Up @@ -18,10 +18,13 @@ import (
"bytes"
"fmt"
"io/ioutil"
"os"
"reflect"
"sync"
"testing"
"time"

"github.com/mattn/go-isatty"
)

const baseWait = 3
Expand Down Expand Up @@ -69,6 +72,10 @@ func TestStart(t *testing.T) {

// TestActive will verify we can tell when a spinner is running
func TestActive(t *testing.T) {
if !isatty.IsTerminal(os.Stdout.Fd()) {
t.Log("not running in a terminal")
return
}
s := New(CharSets[1], 100*time.Millisecond)
if s.Active() {
t.Error("expected a new spinner to not be active")
Expand Down Expand Up @@ -127,6 +134,10 @@ func TestRestart(t *testing.T) {

// TestHookFunctions will verify that hook functions works as expected
func TestHookFunctions(t *testing.T) {
if !isatty.IsTerminal(os.Stdout.Fd()) {
t.Log("not running in a termian")

This comment has been minimized.

Copy link
@QuLogic

QuLogic Feb 13, 2022

Typo: termian

return
}
s := New(CharSets[4], 50*time.Millisecond)
var out syncBuffer
s.Writer = &out
Expand Down

0 comments on commit 561dc95

Please sign in to comment.