From b6812c11307f053f3c899c864e3124d7a0db6364 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 20 Apr 2023 17:03:31 +0200 Subject: [PATCH] ci: run orm tests (#15885) --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ orm/sonar-project.properties | 14 ++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 orm/sonar-project.properties diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aaabfb6782..0ad561d9fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -496,6 +496,36 @@ jobs: with: projectBaseDir: collections/ + test-orm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: 1.20.3 + cache: true + cache-dependency-path: orm/go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + orm/**/*.go + orm/go.mod + orm/go.sum + - name: tests + if: env.GIT_DIFF + run: | + cd orm + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... + - name: sonarcloud + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: orm/ + test-cosmovisor: runs-on: ubuntu-latest steps: diff --git a/orm/sonar-project.properties b/orm/sonar-project.properties new file mode 100644 index 0000000000..868608220c --- /dev/null +++ b/orm/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.projectKey=cosmos-sdk-orm +sonar.organization=cosmos + +sonar.projectName=Cosmos SDK - ORM +sonar.project.monorepo.enabled=true + +sonar.sources=. +sonar.exclusions=**/*_test.go +sonar.tests=. +sonar.test.inclusions=**/*_test.go +sonar.go.coverage.reportPaths=coverage.out + +sonar.sourceEncoding=UTF-8 +sonar.scm.provider=git \ No newline at end of file