Skip to content

Commit

Permalink
Add Github action for the common logging library
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas committed Feb 20, 2024
1 parent 4f86765 commit 8dab098
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 88 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run unit tests
on:
push:
branches: [ "main" ]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
/home/runner/work/common/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up go environment
uses: actions/setup-go@v4
with:
go-version: 1.21.5

- name: Run unit tests
run: make test

9 changes: 7 additions & 2 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ TAG = $(DOCKER_TAG)

.PHONY: build
build:
./before-commit.sh
cd logging && ./before-commit.sh && cd -
go mod vendor
go mod verify
go test -count 100 -race -coverprofile=cover.out ./...

testi:
.PHONY: test
test: build

.PHONY: ci-pr
ci-pr: build
Expand Down
86 changes: 0 additions & 86 deletions common/before-commit.sh

This file was deleted.

0 comments on commit 8dab098

Please sign in to comment.