From 39eee32cfbe9c1f03a05d4c6cc5a2c0871e660e2 Mon Sep 17 00:00:00 2001 From: Gabe Farrell Date: Fri, 15 Mar 2024 05:26:08 +0000 Subject: [PATCH] Add coverage workflow --- .github/workflows/main.yml | 21 +++++++++++++++++++++ README.md | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/main.yml 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.