Skip to content

Commit

Permalink
Add GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
tung.tq committed Oct 16, 2023
1 parent dc7ad2a commit 7730f47
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: go-memcache
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Install Tools
run: make install-tools
- name: Lint
run: make lint
- name: Test
run: make test
- name: Test Race
run: make test-race
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/[email protected]
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: lint test test-race
.PHONY: lint test test-race install-tools

lint:
$(foreach f,$(shell go fmt ./...),@echo "Forgot to format file: ${f}"; exit 1;)
Expand All @@ -9,4 +9,7 @@ test:
go test ./...

test-race:
go test -count=1 -race ./...
go test -count=1 -race ./...

install-tools:
go install github.com/mgechev/revive

0 comments on commit 7730f47

Please sign in to comment.