add github actions

This commit is contained in:
Ruidy 2022-02-22 17:39:47 -04:00
parent 33ab47ea59
commit 1b9576008e
2 changed files with 19 additions and 1 deletions

18
.github/workflows/tests.yaml vendored Normal file
View file

@ -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)

View file

@ -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