ci: configure sonarcloud (#13921)
This commit is contained in:
parent
b425907b95
commit
eb4afa74ba
@ -57,3 +57,6 @@ ignore:
|
||||
- "x/**/test_common.go"
|
||||
- "scripts/"
|
||||
- "contrib"
|
||||
- "**/*.pb.gw.go"
|
||||
- "**/*.pulsar.go"
|
||||
- "tests/mocks/*.go"
|
||||
|
||||
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
@ -119,11 +119,13 @@ jobs:
|
||||
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
|
||||
path: ./${{ matrix.part }}profile.out
|
||||
|
||||
upload-coverage-report:
|
||||
repo-analysis:
|
||||
runs-on: ubuntu-latest
|
||||
needs: tests
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: technote-space/get-diff-action@v6.1.1
|
||||
with:
|
||||
PATTERNS: |
|
||||
@ -154,35 +156,14 @@ jobs:
|
||||
- run: |
|
||||
cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt
|
||||
if: env.GIT_DIFF
|
||||
- name: filter out DONTCOVER
|
||||
run: |
|
||||
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
|
||||
excludelist+=" $(find ./ -type f -name '*.pb.go')"
|
||||
excludelist+=" $(find ./ -type f -name '*.pb.gw.go')"
|
||||
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
|
||||
for filename in ${excludelist}; do
|
||||
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
|
||||
echo "Excluding ${filename} from coverage report..."
|
||||
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
|
||||
done
|
||||
if: env.GIT_DIFF
|
||||
- uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ./coverage.txt
|
||||
if: env.GIT_DIFF
|
||||
|
||||
sonarcloud:
|
||||
name: SonarCloud
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: SonarCloud Scan
|
||||
uses: SonarSource/sonarcloud-github-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
- uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ./coverage.txt
|
||||
|
||||
test-rosetta:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -14,8 +14,11 @@
|
||||
<a href="https://goreportcard.com/report/github.com/cosmos/cosmos-sdk">
|
||||
<img alt="Go report card" src="https://goreportcard.com/badge/github.com/cosmos/cosmos-sdk" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/cosmos/cosmos-sdk">
|
||||
<img alt="Code Coverage" src="https://codecov.io/gh/cosmos/cosmos-sdk/branch/main/graph/badge.svg" />
|
||||
<a href="https://sonarcloud.io/summary/overall?id=cosmos_cosmos-sdk">
|
||||
<img alt="Code Coverage" src="https://sonarcloud.io/api/project_badges/measure?project=cosmos_cosmos-sdk&metric=coverage" />
|
||||
</a>
|
||||
<a href="https://sonarcloud.io/summary/overall?id=cosmos_cosmos-sdk">
|
||||
<img alt="SonarCloud Analysis" src="https://sonarcloud.io/api/project_badges/measure?project=cosmos_cosmos-sdk&metric=alert_status">
|
||||
</a>
|
||||
</div>
|
||||
<div align="center">
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package server
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package server
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package server
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
|
||||
@ -32,8 +32,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
)
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
// ServerContextKey defines the context key used to retrieve a server.Context from
|
||||
// a command's Context.
|
||||
const ServerContextKey = sdk.ContextKey("server.context")
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package cmd
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
|
||||
24
sonar-project.properties
Normal file
24
sonar-project.properties
Normal file
@ -0,0 +1,24 @@
|
||||
sonar.projectKey=cosmos_cosmos-sdk
|
||||
sonar.organization=cosmos
|
||||
|
||||
sonar.projectName=Cosmos SDK
|
||||
sonar.project.monorepo.enabled=true
|
||||
|
||||
sonar.sources=.
|
||||
sonar.exclusions=**/*_test.go,tests/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**,testutil/testdata/**,testutil/testdata_pulsar/**,**/*.java
|
||||
|
||||
sonar.go.coverage.reportPaths=coverage.txt
|
||||
sonar.coverage.exclusions=**/*_test.go,tests/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**,testutil/testdata/**,testutil/testdata_pulsar/**,**/*.java
|
||||
|
||||
sonar.tests=.
|
||||
sonar.test.inclusions=**/*_test.go,tests/**
|
||||
|
||||
sonar.python.version=3
|
||||
sonar.sourceEncoding=UTF-8
|
||||
sonar.scm.provider=git
|
||||
sonar.pullrequest.github.summary_comment=true
|
||||
|
||||
# Exclude C/C++/Objective-C files from analysis
|
||||
sonar.c.file.suffixes=-
|
||||
sonar.cpp.file.suffixes=-
|
||||
sonar.objc.file.suffixes=-
|
||||
1
testutil/testdata/animal.go
vendored
1
testutil/testdata/animal.go
vendored
@ -1,6 +1,5 @@
|
||||
package testdata
|
||||
|
||||
// DONTCOVER
|
||||
// nolint
|
||||
|
||||
import (
|
||||
|
||||
@ -110,5 +110,3 @@ func TxMultiSignBatchExec(clientCtx client.Context, filename string, from string
|
||||
|
||||
return clitestutil.ExecTestCLICmd(clientCtx, cli.GetMultiSignBatchCmd(), args)
|
||||
}
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package types
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
// DONTCOVER
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@ -4,8 +4,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
// DoubleSignJailEndTime period ends at Max Time supported by Amino
|
||||
// (Dec 31, 9999 - 23:59:59 GMT).
|
||||
var DoubleSignJailEndTime = time.Unix(253402300799, 0)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package genutil
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
@ -7,8 +7,6 @@ import (
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
)
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
type (
|
||||
// AppMap map modules names with their json raw representation.
|
||||
AppMap map[string]json.RawMessage
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package keeper
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package gov
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -4,8 +4,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
// query endpoints supported by the governance Querier
|
||||
const (
|
||||
QueryParams = "params"
|
||||
|
||||
@ -4,8 +4,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
// query endpoints supported by the governance Querier
|
||||
const (
|
||||
QueryParams = "params"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package types
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
// Query endpoints supported by the slashing querier
|
||||
const (
|
||||
QueryParameters = "parameters"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user