Skip to content

Commit

Permalink
Merge pull request #7 from schorzz/master
Browse files Browse the repository at this point in the history
Add Github Actions for tests and releases
  • Loading branch information
mdomke authored Aug 5, 2020
2 parents 232dd85 + 31ad001 commit 85c4ec7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Go Testing
on:
push:
branches: [ master ]
pull_request:
jobs:
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.29
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go >= 1.14
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go mod download
- name: Test
run: go test -v -covermode=count ./...
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Artifacts
on:
push:
tags:
- '*'
jobs:
goreleaser:
name: Release Binaries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion version/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestGitDescribe(t *testing.T) {
t.Fatal(err)
}
defer os.RemoveAll(dir)
os.Chdir(dir)
err = os.Chdir(dir)
assert.NoError(err)
assert.Equal("0.0.0-0-", git.Describe())
}

0 comments on commit 85c4ec7

Please sign in to comment.