Skip to content

Commit

Permalink
update github actions, add linter action
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmach committed Dec 27, 2023
1 parent e652b50 commit fdab2f5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21'

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55
25 changes: 9 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,28 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: '1.15.3'

- name: Install dependencies
run: |
go version
go get -u golang.org/x/lint/golint
go-version: '1.21'

- name: Run build
run: go build .
- name: Run vet & lint
run: go build .

- name: Run vet
run: |
go vet .
golint .
- name: Run tests
run: go test -v -coverprofile=profile.cov ./...

- name: codecov
uses: codecov/codecov-action@v1
with:
Expand Down

0 comments on commit fdab2f5

Please sign in to comment.