Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code quality & coverage scanner #6

Merged
merged 4 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ permissions:
contents: read
pull-requests: write
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
Expand All @@ -24,4 +29,11 @@ jobs:
run: go build ./...

- name: Test
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...
run: go test -json -cover -coverprofile=coverage.out -covermode=atomic -v ./... > report.json

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}

12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# go-xmlsecurity
XML Security Toolkit

[![Build & Test](https://github.com/deb-ict/go-xmlsecurity/actions/workflows/build.yml/badge.svg)](https://github.com/deb-ict/go-xmlsecurity/actions/workflows/build.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=deb-ict_go-xmlsecurity&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=deb-ict_go-xmlsecurity)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=deb-ict_go-xmlsecurity&metric=coverage)](https://sonarcloud.io/summary/new_code?id=deb-ict_go-xmlsecurity)

XML security toolkit

## Installation
Install `go-xmlsecurity` using `go get`:

`go get -u github.com/deb-ict/go-xmlsecurity`
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ toolchain go1.23.6

require (
github.com/beevik/etree v1.5.0
github.com/deb-ict/go-xml v1.0.4-alpha
github.com/deb-ict/go-xml v0.0.2-alpha
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/beevik/etree v1.5.0 h1:iaQZFSDS+3kYZiGoc9uKeOkUY3nYMXOKLl6KIJxiJWs=
github.com/beevik/etree v1.5.0/go.mod h1:gPNJNaBGVZ9AwsidazFZyygnd+0pAU38N4D+WemwKNs=
github.com/deb-ict/go-xml v1.0.4-alpha h1:D9xCwOQl2LFqWqBiODFpbiaSCJpyuEbzqXzo59IFVOU=
github.com/deb-ict/go-xml v1.0.4-alpha/go.mod h1:n1mfx+zyWFGk39GzLC5KmPUqbNf85vjrUB/JHL7RlZY=
github.com/deb-ict/go-xml v0.0.2-alpha h1:CSz2V1XcaeGyK23tthfhy3W+pl1lGE5fzSmrxKwq3g4=
github.com/deb-ict/go-xml v0.0.2-alpha/go.mod h1:n1mfx+zyWFGk39GzLC5KmPUqbNf85vjrUB/JHL7RlZY=
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sonar.projectKey=deb-ict_go-xmlsecurity
sonar.organization=deb-ict

sonar.projectName=go-xmlsecurity
sonar.projectVersion=1.0.0

sonar.sources=.
sonar.exclusions=**/*_test.go,**/vendor/**,**/node_modules/**

sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=**/vendor/**
sonar.go.coverage.reportPaths=coverage.out
sonar.go.tests.reportPaths=report.json
Loading