Skip to content

Commit

Permalink
badges: added coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mysiar committed May 22, 2024
1 parent 09b2287 commit d2d9918
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Coverage

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "main" ]

jobs:
coverage:

runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: "1"
check-latest: true

- name: Run tests with coverage report output
run: go test -cover -coverpkg=./... -coverprofile=coverage.out ./...

- uses: k1LoW/octocov-action@v1
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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: tests
name: Tests

on:
push:
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ get::


tests::
rm -rf tests/test.db
rm -f tests/test.db
go test -count=1 -modfile=go_test.mod ./... -v

coverage::
rm -f tests/test.db
go test -count=1 -modfile=go_test.mod -cover -coverpkg=./... -coverprofile=coverage.out ./...
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# go-sql-raw
![tests](https://github.com/mysiar-org/go_sql_raw/actions/workflows/tests.yml/badge.svg)
![Tests](https://github.com/mysiar-org/go_sql_raw/actions/workflows/tests.yml/badge.svg)
[![Go Reference](https://pkg.go.dev/badge/github.com/mysiar-org/go_sql_raw.svg)](https://pkg.go.dev/github.com/mysiar-org/go-sql-raw)
[![Gosec](https://github.com/mysiar-org/go_sql_raw/actions/workflows/gosec.yml/badge.svg)](https://github.com/mysiar-org/go_sql_raw/actions/workflows/gosec.yml)


The main reason that this module has been created was generic querying database without knowing table structure.

Expand Down

0 comments on commit d2d9918

Please sign in to comment.