Skip to content

Commit

Permalink
chore: create a CI/CD Makefile #30
Browse files Browse the repository at this point in the history
  • Loading branch information
SLedunois committed Mar 17, 2022
1 parent d3d1462 commit c49241d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run test and coverage
run: ./scripts/test.sh
run: make test.unit
- name: Send code coverage
if: github.ref == 'refs/heads/main'
run: CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }} bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r coverage.out
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.DEFAULT_GOAL := help
SHELL := /bin/bash

#help: @ list available tasks on this project
help:
@grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

#test.unit: @ run unit tests and coverage
test.unit:
@echo "[TEST.UNIT] run unit tests and coverage"
@go test -race -covermode=atomic -coverprofile=coverage.out \
github.com/SLedunois/b3lbctl/pkg/cmd/root \
github.com/SLedunois/b3lbctl/pkg/cmd/instances \
github.com/SLedunois/b3lbctl/pkg/cmd/clusterinfo \
github.com/SLedunois/b3lbctl/pkg/cmd/config \
github.com/SLedunois/b3lbctl/pkg/admin \
github.com/SLedunois/b3lbctl/pkg/config \
github.com/SLedunois/b3lbctl/pkg/system
10 changes: 0 additions & 10 deletions scripts/test.sh

This file was deleted.

0 comments on commit c49241d

Please sign in to comment.