Skip to content

Commit

Permalink
github action
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 6, 2022
1 parent c3dbbf2 commit 7d73cd6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project_name: carapace-pflag
build:
skip: true
3 changes: 2 additions & 1 deletion flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 7d73cd6

Please sign in to comment.