diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..85e84cf --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + strategy: + matrix: + # go-version: ['oldstable', 'stable', '1.23.0-rc.2'] + go-version: ["oldstable", "stable"] + env: + VERBOSE: 1 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - name: Install tparse + run: go install github.com/mfridman/tparse@main + - name: Build + run: go build -v . + - name: Run tests + shell: bash + run: | + go test $(go list ./... | grep -v 'examples') -count=1 -v -json -cover \ + | tparse -all -follow -sort=elapsed -trimpath=auto diff --git a/README.md b/README.md index 2dd2adf..205f44a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # cli [![GoDoc](https://godoc.org/github.com/mfridman/cli?status.svg)](https://godoc.org/github.com/mfridman/cli) -[![Go Report -Card](https://goreportcard.com/badge/github.com/mfridman/cli)](https://goreportcard.com/report/github.com/mfridman/cli) +[![Go Report Card](https://goreportcard.com/badge/github.com/mfridman/cli)](https://goreportcard.com/report/github.com/mfridman/cli) +[![Actions](https://github.com/mfridman/cli/workflows/ci/badge.svg)](https://github.com/mfridman/cli) A lightweight framework for building Go CLI applications with nested subcommands.