diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..5699165 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,18 @@ +name: Test and coverage + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: actions/setup-go@v2 + with: + go-version: '1.17' + - name: Run coverage + run: go test -race -coverprofile=coverage.out -covermode=atomic + - name: Upload coverage to Codecov + run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/Makefile b/Makefile index 8b4ecce..6556878 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,6 @@ web: cd client && npm run start test: - go test -json -count=1 ./... -coverpkg=./... -coverprofile coverage.txt -covermode=atomic | gotestfmt && go tool cover -html coverage.txt && rm coverage.txt + go test -json -count=1 ./... -coverpkg=./... -coverprofile coverage.out -covermode=atomic | gotestfmt && go tool cover -html coverage.outt && rm coverage.outt .PHONY: lint run dev run-web test build