Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joesonw committed Nov 22, 2023
1 parent 2b44e20 commit 892d140
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: golangci-lint
on:
push:
branches:
- master
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
31 changes: 31 additions & 0 deletions .github/workflows/gotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: go-test
on:
push:
branches:
- master
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: Test
run: go test -covermode atomic -coverprofile=covprofile ./...
- name: Convert coverage profile
run: |
go install github.com/jandelgado/gcov2lcov@latest
gcov2lcov -infile=covprofile -outfile=coverage.lcov
- name: Coveralls
uses: coverallsapp/github-action@v2
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,5 @@ Temporary Items

# End of https://www.toptal.com/developers/gitignore/api/goland,macos

.idea/watcherTasks.xml
.idea/watcherTasks.xml
covprofile

0 comments on commit 892d140

Please sign in to comment.