Skip to content

Commit

Permalink
Unit tests (#4)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
r-goswami committed Jun 3, 2023
1 parent e7ce3d0 commit 96e0a82
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CI

on:
push:
tags:
- v*
branches:
- main
pull_request:
Expand Down Expand Up @@ -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:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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}}
10 changes: 9 additions & 1 deletion .github/workflows/reviewdog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 96e0a82

Please sign in to comment.