From a0876f4157adc7ca8264cf756869c0c610fd9142 Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Wed, 26 Jul 2023 09:10:11 +0100 Subject: [PATCH] ci: Add linter stage to workflow Ensure that submitted merge requests are run through a linter check to keep high code quality. Signed-off-by: Christopher Obbard --- .github/workflows/ci.yaml | 14 ++++++++++++++ .golangci.yml | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 .golangci.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fb43f92..f9d2f451 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,6 +16,20 @@ on: workflow_dispatch: jobs: + golangci: + name: lint + runs-on: ubuntu-latest + defaults: + run: + shell: bash + container: + image: ghcr.io/go-debos/test-containers/debos-trixie:main + steps: + - uses: actions/setup-go@v4 + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + test: strategy: fail-fast: false diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..6b63b2bc --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,5 @@ +linters: + enable: + - gofmt + - stylecheck + - whitespace