From 96e0a82bad7c4bf4d4c6b6016a30aad23caf2bf9 Mon Sep 17 00:00:00 2001 From: Z Man <101930576+r-goswami@users.noreply.github.com> Date: Sat, 3 Jun 2023 14:56:34 +0200 Subject: [PATCH] Unit tests (#4) * test: added few tests in internal package * fix: reviewdog yaml added, some unit tests are updated. * lint error fixed * fix: reviewdog is removed * fix: ignore cmd by codecov * fix: updated ci workflow * test: unit tests added * test:unit tests updated * test: more unit tests related to response structs, reviewdog workflow. * fix: reviewdog workflow corrected * fix: reviewdog yaml * fix: reviedog workflow * fix: reviewdog workflow * fix: release workflow * fix: go-version in reviewdog.yaml --- .github/workflows/CI.yaml | 4 +--- .github/workflows/release.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/reviewdog.yaml | 10 +++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 3598ba2..969f9c4 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -2,8 +2,6 @@ name: CI on: push: - tags: - - v* branches: - main pull_request: @@ -54,7 +52,7 @@ jobs: go-version: 1.19 - name: Run tests run: go test $(go list ./... | grep -v /cmd/) -race -gcflags=-l -v -coverprofile=coverage.txt -covermode=atomic -vet=off - + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c39d6ac --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Release + +on: + push: + tags: + - v* + +jobs: + release: + name: Release on GitHub + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Validates GO releaser config + uses: docker://goreleaser/goreleaser:latest + with: + args: check + + - name: Create release on GitHub + uses: docker://goreleaser/goreleaser:latest + with: + args: release + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/reviewdog.yaml b/.github/workflows/reviewdog.yaml index af9ecf1..5a20043 100644 --- a/.github/workflows/reviewdog.yaml +++ b/.github/workflows/reviewdog.yaml @@ -8,8 +8,16 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v3 with: - go-version: 1.19 fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.19 + - name: misspell + uses: reviewdog/action-misspell@v1 + with: + github_token: ${{ secrets.github_token }} + locale: "US" - name: Run golangci-lint reviewdog uses: reviewdog/action-golangci-lint@v2 with: