github.com/cosmos/cosmos-sdk@v0.50.10/.github/workflows/test.yml (about)

     1  name: Tests / Code Coverage
     2  on:
     3    pull_request:
     4    merge_group:
     5    push:
     6      branches:
     7        - release/v0.50.x
     8  
     9  permissions:
    10    contents: read
    11  
    12  concurrency:
    13    group: ci-${{ github.ref }}-tests
    14    cancel-in-progress: true
    15  
    16  jobs:
    17    split-test-files:
    18      runs-on: ubuntu-latest
    19      steps:
    20        - uses: actions/checkout@v3
    21        - uses: actions/setup-go@v4
    22          with:
    23            go-version: "1.21"
    24            check-latest: true
    25        - name: Create a file with all core Cosmos SDK pkgs
    26          run: go list ./... > pkgs.txt
    27        - name: Split pkgs into 4 files
    28          run: split -d -n l/4 pkgs.txt pkgs.txt.part.
    29        - uses: actions/upload-artifact@v3
    30          with:
    31            name: "${{ github.sha }}-00"
    32            path: ./pkgs.txt.part.00
    33        - uses: actions/upload-artifact@v3
    34          with:
    35            name: "${{ github.sha }}-01"
    36            path: ./pkgs.txt.part.01
    37        - uses: actions/upload-artifact@v3
    38          with:
    39            name: "${{ github.sha }}-02"
    40            path: ./pkgs.txt.part.02
    41        - uses: actions/upload-artifact@v3
    42          with:
    43            name: "${{ github.sha }}-03"
    44            path: ./pkgs.txt.part.03
    45  
    46    tests:
    47      runs-on: ubuntu-latest
    48      needs: split-test-files
    49      strategy:
    50        fail-fast: false
    51        matrix:
    52          part: ["00", "01", "02", "03"]
    53      steps:
    54        - uses: actions/checkout@v3
    55        - uses: actions/setup-go@v4
    56          with:
    57            go-version: "1.21"
    58            check-latest: true
    59            cache: true
    60            cache-dependency-path: go.sum
    61        - uses: technote-space/get-diff-action@v6.1.2
    62          id: git_diff
    63          with:
    64            PATTERNS: |
    65              **/*.go
    66              go.mod
    67              go.sum
    68              **/go.mod
    69              **/go.sum
    70              **/Makefile
    71              Makefile
    72        - uses: actions/download-artifact@v3
    73          with:
    74            name: "${{ github.sha }}-${{ matrix.part }}"
    75        - name: test & coverage report creation
    76          if: env.GIT_DIFF
    77          run: |
    78            cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -race -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock'
    79        - uses: actions/upload-artifact@v3
    80          if: env.GIT_DIFF
    81          with:
    82            name: "${{ github.sha }}-${{ matrix.part }}-coverage"
    83            path: ./${{ matrix.part }}profile.out
    84  
    85    test-integration:
    86      runs-on: ubuntu-latest
    87      steps:
    88        - uses: actions/checkout@v3
    89        - uses: actions/setup-go@v4
    90          with:
    91            go-version: "1.21"
    92            check-latest: true
    93            cache: true
    94            cache-dependency-path: go.sum
    95        - uses: technote-space/get-diff-action@v6.1.2
    96          id: git_diff
    97          with:
    98            PATTERNS: |
    99              **/*.go
   100              go.mod
   101              go.sum
   102              **/go.mod
   103              **/go.sum
   104              **/Makefile
   105              Makefile
   106        - name: integration tests
   107          if: env.GIT_DIFF
   108          run: |
   109            make test-integration-cov
   110        - uses: actions/upload-artifact@v3
   111          if: env.GIT_DIFF
   112          with:
   113            name: "${{ github.sha }}-integration-coverage"
   114            path: ./tests/integration-profile.out
   115  
   116    test-e2e:
   117      runs-on: ubuntu-latest
   118      steps:
   119        - uses: actions/checkout@v3
   120        - uses: actions/setup-go@v4
   121          with:
   122            go-version: "1.21"
   123            check-latest: true
   124            cache: true
   125            cache-dependency-path: go.sum
   126        - uses: technote-space/get-diff-action@v6.1.2
   127          id: git_diff
   128          with:
   129            PATTERNS: |
   130              **/*.go
   131              go.mod
   132              go.sum
   133              **/go.mod
   134              **/go.sum
   135              **/Makefile
   136              Makefile
   137        - name: e2e tests
   138          if: env.GIT_DIFF
   139          run: |
   140            make test-e2e-cov
   141        - uses: actions/upload-artifact@v3
   142          if: env.GIT_DIFF
   143          with:
   144            name: "${{ github.sha }}-e2e-coverage"
   145            path: ./tests/e2e-profile.out
   146  
   147    repo-analysis:
   148      runs-on: ubuntu-latest
   149      needs: [tests, test-integration, test-e2e]
   150      steps:
   151        - uses: actions/checkout@v3
   152        - uses: technote-space/get-diff-action@v6.1.2
   153          id: git_diff
   154          with:
   155            PATTERNS: |
   156              **/*.go
   157              go.mod
   158              go.sum
   159              **/go.mod
   160              **/go.sum
   161        - uses: actions/download-artifact@v3
   162          if: env.GIT_DIFF
   163          with:
   164            name: "${{ github.sha }}-00-coverage"
   165        - uses: actions/download-artifact@v3
   166          if: env.GIT_DIFF
   167          with:
   168            name: "${{ github.sha }}-01-coverage"
   169        - uses: actions/download-artifact@v3
   170          if: env.GIT_DIFF
   171          with:
   172            name: "${{ github.sha }}-02-coverage"
   173        - uses: actions/download-artifact@v3
   174          if: env.GIT_DIFF
   175          with:
   176            name: "${{ github.sha }}-03-coverage"
   177        - uses: actions/download-artifact@v3
   178          if: env.GIT_DIFF
   179          with:
   180            name: "${{ github.sha }}-integration-coverage"
   181        - uses: actions/download-artifact@v3
   182          if: env.GIT_DIFF
   183          with:
   184            name: "${{ github.sha }}-e2e-coverage"
   185          continue-on-error: true
   186        - name: sonarcloud
   187          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }}
   188          uses: SonarSource/sonarcloud-github-action@master
   189          env:
   190            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   191            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   192  
   193    liveness-test:
   194      runs-on: ubuntu-latest
   195      timeout-minutes: 15
   196      steps:
   197        - uses: actions/checkout@v3
   198        - uses: actions/setup-go@v4
   199          with:
   200            go-version: "1.21"
   201            check-latest: true
   202            cache: true
   203            cache-dependency-path: go.sum
   204        - uses: technote-space/get-diff-action@v6.1.2
   205          id: git_diff
   206          with:
   207            PATTERNS: |
   208              **/*.go
   209              go.mod
   210              go.sum
   211              **/go.mod
   212              **/go.sum
   213              **/Makefile
   214              Makefile
   215        - name: start localnet
   216          if: env.GIT_DIFF
   217          run: |
   218            make clean localnet-start
   219        - name: test liveness
   220          if: env.GIT_DIFF
   221          run: |
   222            ./contrib/localnet_liveness.sh 100 5 50 localhost
   223  
   224    test-sim-nondeterminism:
   225      runs-on: ubuntu-latest
   226      steps:
   227        - uses: actions/checkout@v3
   228        - uses: actions/setup-go@v4
   229          with:
   230            go-version: "1.21"
   231            check-latest: true
   232            cache: true
   233            cache-dependency-path: go.sum
   234        - uses: technote-space/get-diff-action@v6.1.2
   235          id: git_diff
   236          with:
   237            PATTERNS: |
   238              **/*.go
   239              go.mod
   240              go.sum
   241              **/go.mod
   242              **/go.sum
   243              **/Makefile
   244              Makefile
   245        - name: test-sim-nondeterminism
   246          if: env.GIT_DIFF
   247          run: |
   248            make test-sim-nondeterminism
   249  
   250    ###############################
   251    #### Cosmos SDK Submodules ####
   252    ###############################
   253  
   254    # NOTE: The following jobs are used to test the Cosmos SDK Go submodules.
   255    # They run when there is a diff in their respective directories.
   256  
   257    test-clientv2:
   258      runs-on: ubuntu-latest
   259      steps:
   260        - uses: actions/checkout@v3
   261        - uses: actions/setup-go@v4
   262          with:
   263            go-version: "1.21"
   264            check-latest: true
   265            cache: true
   266            cache-dependency-path: client/v2/go.sum
   267        - uses: technote-space/get-diff-action@v6.1.2
   268          id: git_diff
   269          with:
   270            PATTERNS: |
   271              client/v2/**/*.go
   272              client/v2/go.mod
   273              client/v2/go.sum
   274        - name: tests
   275          if: env.GIT_DIFF
   276          run: |
   277            cd client/v2
   278            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   279        - name: sonarcloud
   280          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   281          uses: SonarSource/sonarcloud-github-action@master
   282          env:
   283            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   284            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   285          with:
   286            projectBaseDir: client/v2/
   287  
   288    test-core:
   289      runs-on: ubuntu-latest
   290      steps:
   291        - uses: actions/checkout@v3
   292        - uses: actions/setup-go@v4
   293          with:
   294            go-version: "1.20"
   295            check-latest: true
   296            cache: true
   297            cache-dependency-path: core/go.sum
   298        - uses: technote-space/get-diff-action@v6.1.2
   299          id: git_diff
   300          with:
   301            PATTERNS: |
   302              core/**/*.go
   303              core/go.mod
   304              core/go.sum
   305        - name: tests
   306          if: env.GIT_DIFF
   307          run: |
   308            cd core
   309            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   310        - name: sonarcloud
   311          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   312          uses: SonarSource/sonarcloud-github-action@master
   313          env:
   314            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   315            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   316          with:
   317            projectBaseDir: core/
   318  
   319    test-depinject:
   320      runs-on: ubuntu-latest
   321      steps:
   322        - uses: actions/checkout@v3
   323        - uses: actions/setup-go@v4
   324          with:
   325            go-version: "1.20"
   326            check-latest: true
   327            cache: true
   328            cache-dependency-path: depinject/go.sum
   329        - uses: technote-space/get-diff-action@v6.1.2
   330          id: git_diff
   331          with:
   332            PATTERNS: |
   333              depinject/**/*.go
   334              depinject/go.mod
   335              depinject/go.sum
   336        - name: tests
   337          if: env.GIT_DIFF
   338          run: |
   339            cd depinject
   340            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   341        - name: sonarcloud
   342          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   343          uses: SonarSource/sonarcloud-github-action@master
   344          env:
   345            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   346            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   347  
   348    test-errors:
   349      runs-on: ubuntu-latest
   350      steps:
   351        - uses: actions/checkout@v3
   352        - uses: actions/setup-go@v4
   353          with:
   354            go-version: "1.20"
   355            check-latest: true
   356            cache: true
   357            cache-dependency-path: errors/go.sum
   358        - uses: technote-space/get-diff-action@v6.1.2
   359          id: git_diff
   360          with:
   361            PATTERNS: |
   362              errors/**/*.go
   363              errors/go.mod
   364              errors/go.sum
   365        - name: tests
   366          if: env.GIT_DIFF
   367          run: |
   368            cd errors
   369            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   370        - name: sonarcloud
   371          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   372          uses: SonarSource/sonarcloud-github-action@master
   373          env:
   374            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   375            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   376          with:
   377            projectBaseDir: errors/
   378  
   379    test-math:
   380      runs-on: ubuntu-latest
   381      steps:
   382        - uses: actions/checkout@v3
   383        - uses: actions/setup-go@v4
   384          with:
   385            go-version: "1.20"
   386            check-latest: true
   387            cache: true
   388            cache-dependency-path: math/go.sum
   389        - uses: technote-space/get-diff-action@v6.1.2
   390          id: git_diff
   391          with:
   392            PATTERNS: |
   393              math/**/*.go
   394              math/go.mod
   395              math/go.sum
   396        - name: tests
   397          if: env.GIT_DIFF
   398          run: |
   399            cd math
   400            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   401        - name: sonarcloud
   402          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   403          uses: SonarSource/sonarcloud-github-action@master
   404          env:
   405            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   406            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   407          with:
   408            projectBaseDir: math/
   409  
   410    test-simapp:
   411      runs-on: ubuntu-latest
   412      steps:
   413        - uses: actions/checkout@v3
   414        - uses: actions/setup-go@v4
   415          with:
   416            go-version: "1.21"
   417            check-latest: true
   418            cache: true
   419            cache-dependency-path: simapp/go.sum
   420        - uses: technote-space/get-diff-action@v6.1.2
   421          id: git_diff
   422          with:
   423            PATTERNS: |
   424              **/*.go
   425              simapp/go.mod
   426              simapp/go.sum
   427        - name: tests simapp
   428          if: env.GIT_DIFF
   429          run: |
   430            cd simapp
   431            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   432        - name: tests simapp v1
   433          if: env.GIT_DIFF
   434          run: |
   435            cd simapp
   436            go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./...
   437  
   438    test-collections:
   439      runs-on: ubuntu-latest
   440      steps:
   441        - uses: actions/checkout@v3
   442        - uses: actions/setup-go@v4
   443          with:
   444            go-version: "1.21"
   445            check-latest: true
   446            cache: true
   447            cache-dependency-path: collections/go.sum
   448        - uses: technote-space/get-diff-action@v6.1.2
   449          id: git_diff
   450          with:
   451            PATTERNS: |
   452              collections/**/*.go
   453              collections/go.mod
   454              collections/go.sum
   455        - name: tests
   456          if: env.GIT_DIFF
   457          run: |
   458            cd collections
   459            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   460        - name: sonarcloud
   461          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   462          uses: SonarSource/sonarcloud-github-action@master
   463          env:
   464            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   465            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   466          with:
   467            projectBaseDir: collections/
   468  
   469    test-orm:
   470      runs-on: ubuntu-latest
   471      steps:
   472        - uses: actions/checkout@v3
   473        - uses: actions/setup-go@v4
   474          with:
   475            go-version: "1.20"
   476            check-latest: true
   477            cache: true
   478            cache-dependency-path: orm/go.sum
   479        - uses: technote-space/get-diff-action@v6.1.2
   480          id: git_diff
   481          with:
   482            PATTERNS: |
   483              orm/**/*.go
   484              orm/go.mod
   485              orm/go.sum
   486        - name: tests
   487          if: env.GIT_DIFF
   488          run: |
   489            cd orm
   490            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   491        - name: sonarcloud
   492          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   493          uses: SonarSource/sonarcloud-github-action@master
   494          env:
   495            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   496            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   497          with:
   498            projectBaseDir: orm/
   499  
   500    test-cosmovisor:
   501      runs-on: ubuntu-latest
   502      steps:
   503        - uses: actions/checkout@v3
   504        - uses: actions/setup-go@v4
   505          with:
   506            go-version: "1.21"
   507            check-latest: true
   508            cache: true
   509            cache-dependency-path: tools/cosmovisor/go.sum
   510        - uses: technote-space/get-diff-action@v6.1.2
   511          id: git_diff
   512          with:
   513            PATTERNS: |
   514              tools/cosmovisor/**/*.go
   515              tools/cosmovisor/go.mod
   516              tools/cosmovisor/go.sum
   517        - name: tests
   518          if: env.GIT_DIFF
   519          run: |
   520            cd tools/cosmovisor
   521            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   522        - name: sonarcloud
   523          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   524          uses: SonarSource/sonarcloud-github-action@master
   525          env:
   526            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   527            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   528          with:
   529            projectBaseDir: tools/cosmovisor/
   530  
   531    test-confix:
   532      runs-on: ubuntu-latest
   533      steps:
   534        - uses: actions/checkout@v3
   535        - uses: actions/setup-go@v4
   536          with:
   537            go-version: "1.21"
   538            check-latest: true
   539            cache: true
   540            cache-dependency-path: tools/confix/go.sum
   541        - uses: technote-space/get-diff-action@v6.1.2
   542          id: git_diff
   543          with:
   544            PATTERNS: |
   545              tools/confix/**/*.go
   546              tools/confix/go.mod
   547              tools/confix/go.sum
   548        - name: tests
   549          if: env.GIT_DIFF
   550          run: |
   551            cd tools/confix
   552            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   553        - name: sonarcloud
   554          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   555          uses: SonarSource/sonarcloud-github-action@master
   556          env:
   557            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   558            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   559          with:
   560            projectBaseDir: tools/confix/
   561  
   562    test-hubl:
   563      runs-on: ubuntu-latest
   564      steps:
   565        - uses: actions/checkout@v3
   566        - uses: actions/setup-go@v4
   567          with:
   568            go-version: "1.21"
   569            check-latest: true
   570            cache: true
   571            cache-dependency-path: tools/hubl/go.sum
   572        - uses: technote-space/get-diff-action@v6.1.2
   573          id: git_diff
   574          with:
   575            PATTERNS: |
   576              tools/hubl/**/*.go
   577              tools/hubl/go.mod
   578              tools/hubl/go.sum
   579        - name: tests
   580          if: env.GIT_DIFF
   581          run: |
   582            cd tools/hubl
   583            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   584        - name: sonarcloud
   585          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   586          uses: SonarSource/sonarcloud-github-action@master
   587          env:
   588            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   589            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   590          with:
   591            projectBaseDir: tools/hubl/
   592  
   593    test-store:
   594      runs-on: ubuntu-latest
   595      steps:
   596        - uses: actions/checkout@v3
   597        - uses: actions/setup-go@v4
   598          with:
   599            go-version: "1.20"
   600            check-latest: true
   601            cache: true
   602            cache-dependency-path: store/go.sum
   603        - uses: technote-space/get-diff-action@v6.1.2
   604          id: git_diff
   605          with:
   606            PATTERNS: |
   607              store/**/*.go
   608              store/go.mod
   609              store/go.sum
   610        - name: tests
   611          if: env.GIT_DIFF
   612          run: |
   613            cd store
   614            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   615        - name: sonarcloud
   616          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   617          uses: SonarSource/sonarcloud-github-action@master
   618          env:
   619            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   620            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   621          with:
   622            projectBaseDir: store/
   623  
   624    test-log:
   625      runs-on: ubuntu-latest
   626      steps:
   627        - uses: actions/checkout@v3
   628        - uses: actions/setup-go@v4
   629          with:
   630            go-version: "1.20"
   631            check-latest: true
   632            cache: true
   633            cache-dependency-path: log/go.sum
   634        - uses: technote-space/get-diff-action@v6.1.2
   635          id: git_diff
   636          with:
   637            PATTERNS: |
   638              log/*.go
   639              log/go.mod
   640              log/go.sum
   641        - name: tests
   642          if: env.GIT_DIFF
   643          run: |
   644            cd log
   645            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   646        - name: sonarcloud
   647          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   648          uses: SonarSource/sonarcloud-github-action@master
   649          env:
   650            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   651            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   652          with:
   653            projectBaseDir: log/
   654  
   655    #############################
   656    ### Cosmos SDK x/{module} ###
   657    #############################
   658  
   659    # NOTE: The following jobs are used to test the Cosmos SDK Go submodules present under x/{module}.
   660    # They run when there is a diff in their respective directories.
   661  
   662    test-x-tx:
   663      runs-on: ubuntu-latest
   664      steps:
   665        - uses: actions/checkout@v3
   666        - uses: actions/setup-go@v4
   667          with:
   668            go-version: "1.21"
   669            check-latest: true
   670            cache: true
   671            cache-dependency-path: x/tx/go.sum
   672        - uses: technote-space/get-diff-action@v6.1.2
   673          id: git_diff
   674          with:
   675            PATTERNS: |
   676              x/tx/**/*.go
   677              x/tx/go.mod
   678              x/tx/go.sum
   679        - name: tests
   680          if: env.GIT_DIFF
   681          run: |
   682            cd x/tx
   683            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   684        - name: sonarcloud
   685          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   686          uses: SonarSource/sonarcloud-github-action@master
   687          env:
   688            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   689            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   690          with:
   691            projectBaseDir: x/tx/
   692  
   693    test-x-nft:
   694      runs-on: ubuntu-latest
   695      steps:
   696        - uses: actions/checkout@v3
   697        - uses: actions/setup-go@v4
   698          with:
   699            go-version: "1.21"
   700            check-latest: true
   701            cache: true
   702            cache-dependency-path: x/nft/go.sum
   703        - uses: technote-space/get-diff-action@v6.1.2
   704          id: git_diff
   705          with:
   706            PATTERNS: |
   707              x/nft/**/*.go
   708              x/nft/go.mod
   709              x/nft/go.sum
   710        - name: tests
   711          if: env.GIT_DIFF
   712          run: |
   713            cd x/nft
   714            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   715        - name: sonarcloud
   716          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   717          uses: SonarSource/sonarcloud-github-action@master
   718          env:
   719            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   720            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   721          with:
   722            projectBaseDir: x/nft/
   723  
   724    test-x-circuit:
   725      runs-on: ubuntu-latest
   726      steps:
   727        - uses: actions/checkout@v3
   728        - uses: actions/setup-go@v4
   729          with:
   730            go-version: "1.21"
   731            check-latest: true
   732            cache: true
   733            cache-dependency-path: x/circuit/go.sum
   734        - uses: technote-space/get-diff-action@v6.1.2
   735          id: git_diff
   736          with:
   737            PATTERNS: |
   738              x/circuit/**/*.go
   739              x/circuit/go.mod
   740              x/circuit/go.sum
   741        - name: tests
   742          if: env.GIT_DIFF
   743          run: |
   744            cd x/circuit
   745            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   746        - name: sonarcloud
   747          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   748          uses: SonarSource/sonarcloud-github-action@master
   749          env:
   750            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   751            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   752          with:
   753            projectBaseDir: x/circuit/
   754  
   755    test-x-feegrant:
   756      runs-on: ubuntu-latest
   757      steps:
   758        - uses: actions/checkout@v3
   759        - uses: actions/setup-go@v4
   760          with:
   761            go-version: "1.21"
   762            check-latest: true
   763            cache: true
   764            cache-dependency-path: x/feegrant/go.sum
   765        - uses: technote-space/get-diff-action@v6.1.2
   766          id: git_diff
   767          with:
   768            PATTERNS: |
   769              x/feegrant/**/*.go
   770              x/feegrant/go.mod
   771              x/feegrant/go.sum
   772        - name: tests
   773          if: env.GIT_DIFF
   774          run: |
   775            cd x/feegrant
   776            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   777        - name: sonarcloud
   778          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   779          uses: SonarSource/sonarcloud-github-action@master
   780          env:
   781            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   782            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   783          with:
   784            projectBaseDir: x/feegrant/
   785  
   786    test-x-evidence:
   787      runs-on: ubuntu-latest
   788      steps:
   789        - uses: actions/checkout@v3
   790        - uses: actions/setup-go@v4
   791          with:
   792            go-version: "1.21"
   793            check-latest: true
   794            cache: true
   795            cache-dependency-path: x/evidence/go.sum
   796        - uses: technote-space/get-diff-action@v6.1.2
   797          id: git_diff
   798          with:
   799            PATTERNS: |
   800              x/evidence/**/*.go
   801              x/evidence/go.mod
   802              x/evidence/go.sum
   803        - name: tests
   804          if: env.GIT_DIFF
   805          run: |
   806            cd x/evidence
   807            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   808        - name: sonarcloud
   809          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   810          uses: SonarSource/sonarcloud-github-action@master
   811          env:
   812            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   813            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   814          with:
   815            projectBaseDir: x/evidence/
   816    test-x-upgrade:
   817      runs-on: ubuntu-latest
   818      steps:
   819        - uses: actions/checkout@v3
   820        - uses: actions/setup-go@v4
   821          with:
   822            go-version: "1.21"
   823            check-latest: true
   824            cache: true
   825            cache-dependency-path: x/upgrade/go.sum
   826        - uses: technote-space/get-diff-action@v6.1.2
   827          id: git_diff
   828          with:
   829            PATTERNS: |
   830              x/upgrade/**/*.go
   831              x/upgrade/go.mod
   832              x/upgrade/go.sum
   833        - name: tests
   834          if: env.GIT_DIFF
   835          run: |
   836            cd x/upgrade
   837            go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
   838        - name: sonarcloud
   839          if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
   840          uses: SonarSource/sonarcloud-github-action@master
   841          env:
   842            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   843            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
   844          with:
   845            projectBaseDir: x/upgrade/