diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..abca960e --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,41 @@ +name: Go + +on: + pull_request: + push: + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: shallow clone + uses: actions/checkout@v2 + if: "!startsWith(github.ref, 'refs/tags/')" + + - name: deep clone + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.19 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..1c819058 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,3 @@ +project_name: carapace-pflag +build: + skip: true diff --git a/flag_test.go b/flag_test.go index 508550de..eec1ecef 100644 --- a/flag_test.go +++ b/flag_test.go @@ -1237,7 +1237,8 @@ func TestPrintDefaults(t *testing.T) { got := buf.String() if got != defaultOutput { fmt.Println("\n" + got) - fmt.Println("\n" + defaultOutput) + fmt.Print("\n" + defaultOutput) + fmt.Println() t.Errorf("got %q want %q\n", got, defaultOutput) } }