diff --git a/.github/coverage.html b/.github/coverage.html deleted file mode 100644 index efe446a..0000000 --- a/.github/coverage.html +++ /dev/null @@ -1,1667 +0,0 @@ - - - - - - go-sqlite3: Go Coverage Report - - - -
- -
- not tracked - - not covered - covered - -
-
-
- - - - - - - - - - - - - - - - - - - - - -
- - - diff --git a/.github/coverage.sh b/.github/coverage.sh deleted file mode 100755 index 97d3ac7..0000000 --- a/.github/coverage.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -SCRIPT_DIR="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")" - -go test ./... -coverprofile "$SCRIPT_DIR/coverage.out" -go tool cover -html="$SCRIPT_DIR/coverage.out" -o "$SCRIPT_DIR/coverage.html" -COVERAGE=$(go tool cover -func="$SCRIPT_DIR/coverage.out" | tail -1 | grep -Eo '\d+\.\d') - -echo "coverage: $COVERAGE% of statements" - -COLOR=orange -if awk "BEGIN {exit !($COVERAGE <= 50)}"; then - COLOR=red -elif awk "BEGIN {exit !($COVERAGE > 80)}"; then - COLOR=green -fi -curl -s "https://img.shields.io/badge/coverage-$COVERAGE%25-$COLOR" > "$SCRIPT_DIR/coverage.svg" - -git add "$SCRIPT_DIR/coverage.html" "$SCRIPT_DIR/coverage.svg" \ No newline at end of file diff --git a/.github/coverage.svg b/.github/coverage.svg deleted file mode 100644 index ea2a384..0000000 --- a/.github/coverage.svg +++ /dev/null @@ -1 +0,0 @@ -coverage: 71.4%coverage71.4% \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c9729b0..6714928 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,6 +1,3 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - name: Go on: @@ -22,10 +19,14 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: stable - name: Build run: go build -v ./... - name: Test run: go test -v ./... + + - if: matrix.os == 'ubuntu-latest' + name: Update coverage report + uses: ncruces/go-coverage-report@main \ No newline at end of file diff --git a/README.md b/README.md index 324feeb..8c4908f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Go Reference](https://pkg.go.dev/badge/image)](https://pkg.go.dev/github.com/ncruces/go-sqlite3) [![Go Report](https://goreportcard.com/badge/github.com/ncruces/go-sqlite3)](https://goreportcard.com/report/github.com/ncruces/go-sqlite3) -[![Go Coverage](.github/coverage.svg)](https://raw.githack.com/ncruces/go-sqlite3/main/.github/coverage.html) +[![Go Coverage](https://github.com/ncruces/go-sqlite3/wiki/coverage.svg)](https://raw.githack.com/wiki/ncruces/go-sqlite3/coverage.html) ⚠️ CAUTION ⚠️