diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2009fb7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +on: + push: + branches: + - main +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + + - name: generate test coverage + run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... + + - name: check test coverage + uses: vladopajic/go-test-coverage@v2 + with: + profile: cover.out + local-prefix: github.com/gabehf/go-elo + git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} + git-branch: badges diff --git a/README.md b/README.md index 81d8f8d..e8e6188 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # go-elo: A flexible elo calculator for Go +![coverage](https://raw.githubusercontent.com/gabehf/go-elo/badges/.badges/main/coverage.svg) + This package allows you to add flexible elo/skill tracking to your application. Go-elo supports unscored (win/loss) and scored matches, with options to tailor the elo curve to your liking.