From 262872e673eedbc08c59c19f7c17ec916b5a3299 Mon Sep 17 00:00:00 2001 From: Chiman Jain Date: Wed, 15 Nov 2023 10:44:09 +0530 Subject: [PATCH] run unit test in github action and update golangci-lint --- .github/workflows/actions.yml | 21 +++++++++++++++++++-- .github/workflows/linters.yaml | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index d4052cf9..44bb6c6f 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,9 +1,9 @@ name: Workflow on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: code-check: name: Check Go formatting, linting, vetting @@ -36,3 +36,20 @@ jobs: with: directories: . options: -ri + unit_test: + name: Run Go unit tests + runs-on: ubuntu-latest + steps: + - name: Download Go + uses: actions/setup-go@v2 + with: + go-version: "1.21" + - name: Checkout the code + uses: actions/checkout@v4 + - name: Vendor packages + run: | + go mod vendor + - name: Test + env: + GOPROXY: "https://proxy.golang.org" + run: cd service; go clean -cache; go test -v . diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index ceda4268..9ceed48f 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -26,5 +26,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.54 + version: v1.55 skip-cache: true