Skip to content

Commit

Permalink
Merge pull request #39 from CoderTH/add-ut-ci-step
Browse files Browse the repository at this point in the history
feat: add github ci step
  • Loading branch information
elezar authored Jan 25, 2024
2 parents 58ae162 + 77e13b0 commit 5f8e1c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/golang-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ jobs:
version: latest
args: -v --timeout 5m
skip-cache: true
test:
name: Unit test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- run: make test
build:
runs-on: ubuntu-latest
steps:
Expand All @@ -46,6 +57,3 @@ jobs:

- name: Build
run: make docker-build

- name: Tests
run: make docker-coverage
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ golangci-lint:

COVERAGE_FILE := coverage.out
test: build cmds
go test -v -coverprofile=$(COVERAGE_FILE) $(MODULE)/...
go test -race -cover -v -coverprofile=$(COVERAGE_FILE) $(MODULE)/...

coverage: test
cat $(COVERAGE_FILE) | grep -v "_mock.go" > $(COVERAGE_FILE).no-mocks
Expand Down

0 comments on commit 5f8e1c7

Please sign in to comment.