Skip to content

Commit c98f9f4

Browse files
authored
Badges (#7)
* badges: LICENSE * badges: update * badges: update * badges: update * badges: update * badges: added gosec * badges: gosec on update * badges: jobs name * badges: added coverage * badges: update * badges: update * badges: update * badges: update
1 parent 82711d4 commit c98f9f4

File tree

7 files changed

+107
-5
lines changed

7 files changed

+107
-5
lines changed

Diff for: .github/workflows/coverage.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
coverage:
11+
12+
runs-on: self-hosted
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-go@v5
18+
with:
19+
go-version: "1"
20+
check-latest: true
21+
22+
- name: Dependencies
23+
run: make get
24+
25+
- name: Run tests with coverage report output
26+
run: make coverage
27+
28+
- uses: k1LoW/octocov-action@v1

Diff for: .github/workflows/gosec.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Gosec
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
gosec_tests:
11+
runs-on: self-hosted
12+
env:
13+
GO111MODULE: on
14+
steps:
15+
- name: Checkout Source
16+
uses: actions/checkout@v4
17+
- name: Run Gosec Security Scanner
18+
uses: securego/gosec@master
19+
with:
20+
args: --exclude-dir=examples --exclude-dir=aws ./...

Diff for: .github/workflows/go.yml renamed to .github/workflows/tests.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build a golang project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
33

4-
name: go_sql_raw
4+
name: Tests
55

66
on:
77
push:
@@ -10,8 +10,7 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
14-
test:
13+
unit_test:
1514
runs-on: self-hosted
1615
steps:
1716
- uses: actions/checkout@v4

Diff for: .octocov.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
coverage:
2+
if: true
3+
acceptable: 80%
4+
badge:
5+
path: docs/coverage.svg
6+
diff:
7+
datastores:
8+
- artifact://${GITHUB_REPOSITORY}
9+
comment:
10+
if: is_pull_request
11+
summary:
12+
if: true
13+
report:
14+
if: is_default_branch
15+
datastores:
16+
- artifact://${GITHUB_REPOSITORY}
17+
codeToTestRatio:
18+
codeToTestRatio:
19+
code:
20+
- '**/*.go'
21+
- '!**/*_test.go'
22+
test:
23+
- '**/*_test.go'
24+
badge:
25+
path: docs/ratio.svg
26+
testExecutionTime:
27+
badge:
28+
path: docs/time.svg

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Piotr Synowiec
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ get::
55

66

77
tests::
8-
rm -rf tests/test.db
8+
rm -f tests/test.db
99
go test -count=1 -modfile=go_test.mod ./... -v
10+
11+
coverage::
12+
rm -f tests/test.db
13+
go test -count=1 -modfile=go_test.mod -cover -coverpkg=./... -coverprofile=coverage.out ./...

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# go-sql-raw
2-
![tests](https://github.com/mysiar-org/go_sql_raw/actions/workflows/go.yml/badge.svg)
2+
![Tests](https://github.com/mysiar-org/go_sql_raw/actions/workflows/tests.yml/badge.svg)
3+
[![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)
4+
[![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)
35

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

0 commit comments

Comments
 (0)