From fdab2f5b5796e6d7b8078b10576149f6803bdc5b Mon Sep 17 00:00:00 2001 From: Paul Mach Date: Wed, 27 Dec 2023 14:31:24 -0800 Subject: [PATCH] update github actions, add linter action --- .github/workflows/golangci-lint.yml | 24 ++++++++++++++++++++++++ .github/workflows/main.yml | 25 +++++++++---------------- 2 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml 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: