diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..3f54189 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 70c7be3..1782570 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: