From ff31988c0365987b63fdf5906fbce199bf2a04a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Va=C5=A1ko?= Date: Thu, 3 Aug 2023 17:55:10 +0200 Subject: [PATCH] Add lint job to CI (#101) Signed-off-by: Ondrej Vasko --- .github/workflows/tests.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c9cd971..f3a7f91 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,8 +2,34 @@ name: Integration tests with Kind and DevStack on: [pull_request] jobs: + lint: + name: "Linters (go v${{ matrix.go-version }})" + runs-on: ubuntu-20.04 + strategy: + matrix: + go-version: [ '1.20' ] + steps: + - name: Checkout velero-plugin-for-openstack + uses: actions/checkout@v3 + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + - name: Check formatting + run: | + test -z $(gofmt -l -s ./) + - name: Check go vet + run: | + go vet ./... + - name: Verify dependencies + run: | + go mod verify + - name: Check if plugin can be built + run: | + go build -v . unit-test: name: "Unit tests (go v${{ matrix.go-version }})" + needs: lint runs-on: ubuntu-20.04 strategy: matrix: