From 6e1ed7cd3ce563fe7e3c49c4bd5d473af65d4223 Mon Sep 17 00:00:00 2001 From: Sanath Kumar Date: Fri, 26 Jan 2024 18:36:18 -0700 Subject: [PATCH] test: setup makefile and ci jobs for tests (#13) --- .github/workflows/base-ci.yml | 15 +++++++++++++++ Makefile | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/base-ci.yml b/.github/workflows/base-ci.yml index d8c5ba7..91fee19 100644 --- a/.github/workflows/base-ci.yml +++ b/.github/workflows/base-ci.yml @@ -45,3 +45,18 @@ jobs: - name: Make Build Docker Images run: make build-image + + test: + name: Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v4 + with: + go-version: '^1.21.3' # The Go version to download (if necessary) and use. + + - name: Unit Tests + run: make unit-test \ No newline at end of file diff --git a/Makefile b/Makefile index b806d17..39e160b 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,14 @@ clean: $(info Running clean...) @rm -rf bin/* +test: + $(info Running tests...) + @$(MAKE) unit-test + +unit-test: + $(info Running unit-tests...) + go test -v -race -cover ./... + build: @$(MAKE) build-go @$(MAKE) build-image