From b72306295f9bcb0c8dc727d668bde9e2ceafa0ce 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 | 16 ++++++++++++++++ .golangci.yml | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 .golangci.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fb43f92..0697af8e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,22 @@ 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: + needs: lint strategy: fail-fast: false matrix: @@ -177,6 +192,7 @@ jobs: name: allgreen if: always() needs: + - lint - unit-tests - recipe-tests runs-on: ubuntu-latest 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