diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e168080 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Verify gofmt + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "The following files are not gofmt'd:" + echo "$unformatted" + exit 1 + fi + + - name: Test + run: go test -v ./... diff --git a/go.mod b/go.mod index f936e51..e8db3f0 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,12 @@ module github.com/sfreiberg/progress -go 1.12 +go 1.26 + +require github.com/nlopes/slack v0.5.0 require ( github.com/gorilla/websocket v1.4.0 // indirect - github.com/nlopes/slack v0.5.0 + github.com/lusis/slack-test v0.0.0-20190426140909-c40012f20018 // indirect github.com/pkg/errors v0.8.1 // indirect + github.com/stretchr/testify v1.12.1 // indirect ) diff --git a/go.sum b/go.sum index 771062f..36e0239 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,12 @@ github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/lusis/slack-test v0.0.0-20190426140909-c40012f20018 h1:MNApn+Z+fIT4NPZopPfCc1obT6aY3SVM6DOctz1A9ZU= +github.com/lusis/slack-test v0.0.0-20190426140909-c40012f20018/go.mod h1:sFlOUpQL1YcjhFVXhg1CG8ZASEs/Mf1oVb6H75JL/zg= github.com/nlopes/slack v0.5.0 h1:NbIae8Kd0NpqaEI3iUrsuS0KbcEDhzhc939jLW5fNm0= github.com/nlopes/slack v0.5.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= diff --git a/progress_test.go b/progress_test.go index 8779692..042885d 100644 --- a/progress_test.go +++ b/progress_test.go @@ -15,7 +15,7 @@ func TestProgressBar(t *testing.T) { ) if token == "" || channel == "" { - t.Fatalf("You must set the SLACK_TOKEN and SLACK_CHANNEL environment variables.") + t.Skip("SLACK_TOKEN and SLACK_CHANNEL not set; skipping integration test.") } pbar := progress.New(token, channel, nil)