Skip to content

Commit

Permalink
Merge branch 'main' into sam/lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
samricotta committed Jun 3, 2024
2 parents a3eed8f + 74d89bf commit 87ad512
Show file tree
Hide file tree
Showing 1,063 changed files with 91,515 additions and 26,447 deletions.
15 changes: 14 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ please add links to any relevant follow up issues.*

I have...

* [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
* [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title, you can find examples of the prefixes below:
<!-- * `feat`: A new feature
* `fix`: A bug fix
* `docs`: Documentation only changes
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* `refactor`: A code change that neither fixes a bug nor adds a feature
* `perf`: A code change that improves performance
* `test`: Adding missing tests or correcting existing tests
* `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* `chore`: Other changes that don't modify src or test files
* `revert`: Reverts a previous commit -->
* [ ] confirmed `!` in the type prefix if API or client breaking change
* [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
* [ ] provided a link to the relevant issue or specification
Expand All @@ -29,6 +40,8 @@ I have...
*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

Please see [Pull Request Reviewer section in the contributing guide](../CONTRIBUTING.md#reviewer) for more information on how to review a pull request.

I have...

* [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
Expand Down
38 changes: 0 additions & 38 deletions .github/PULL_REQUEST_TEMPLATE/docs.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.22.2"
check-latest: true
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/pr-go-mod-tidy-mocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Checks dependencies and mocks generation"
on:
merge_group:
pull_request:
push:
branches:
- main

concurrency:
group: ci-${{ github.ref }}-pr-go-mod-tidy-mocks
cancel-in-progress: true

jobs:
go-mod-tidy:
name: Check go mod tidy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- name: Run go mod tidy
run: ./scripts/go-mod-tidy-all.sh
- name: Check for diffs
run: |
git diff --exit-code || {
echo "Please run './scripts/go-mod-tidy-all.sh' and commit the changes";
exit 1;
}
generate-mocks:
name: Check up to date mocks
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- name: Generate mocks
run: make mocks
- name: Check for diffs
run: |
git diff --exit-code || {
echo "Please run 'make mocks' and commit the changes";
exit 1;
}
4 changes: 2 additions & 2 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.31.0
- uses: bufbuild/buf-setup-action@v1.32.2
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.31.0
- uses: bufbuild/buf-setup-action@v1.32.2
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
78 changes: 35 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ jobs:
name: "testnet-setup"
path: ./systemtests/testnet/
retention-days: 3
# - name: system tests v2
# if: env.GIT_DIFF
# run: |
# make test-system
- name: system tests v2
if: env.GIT_DIFF
run: |
make test-system
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down Expand Up @@ -241,37 +241,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

liveness-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
**/*.go
go.mod
go.sum
**/go.mod
**/go.sum
**/Makefile
Makefile
- name: start localnet
if: env.GIT_DIFF
run: |
make clean localnet-start
- name: test liveness
if: env.GIT_DIFF
run: |
./contrib/localnet_liveness.sh 100 5 50 localhost
test-sim-nondeterminism:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -485,14 +454,6 @@ jobs:
run: |
cd simapp
go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock' ./...
- 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: simapp/
test-collections:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -1327,3 +1288,34 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/epochs/

test-x-consensus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: x/consensus/go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
x/consensus/**/*.go
x/consensus/go.mod
x/consensus/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd x/consensus
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
- 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: x/consensus/
63 changes: 63 additions & 0 deletions .github/workflows/v2-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: v2 core Tests
on:
pull_request:
merge_group:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}-v2-tests
cancel-in-progress: true

jobs:
stf:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
server/v2/stf/**/*.go
server/v2/stf/go.mod
server/v2/stf/go.sum
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd server/v2/stf && go test -mod=readonly -race -timeout 30m -covermode=atomic -tags='ledger test_ledger_mock'
appamanger:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
server/v2/appmanager/**/*.go
server/v2/appmanager/go.mod
server/v2/appmanager/go.sum
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd server/v2/appmanager && go test -mod=readonly -race -timeout 30m -covermode=atomic -tags='ledger test_ledger_mock'
27 changes: 12 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
run:
tests: true
timeout: 15m
sort-results: true
allow-parallel-runners: true
exclude-dir: testutil/testdata
skip-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
- crypto/keys/secp256k1/internal/*
- types/coin_regex.go

build-tags:
build-tags:
- e2e
- ledger
- test_ledger_mock
Expand All @@ -24,6 +13,7 @@ linters:
enable:
- dogsled
- errcheck
- errorlint
- exportloopref
- gci
- goconst
Expand All @@ -45,6 +35,16 @@ linters:
- unused

issues:
exclude-dirs:
- testutil/testdata
exclude-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
- crypto/keys/secp256k1/internal/*
- types/coin_regex.go
exclude-rules:
- text: "Use of weak random number generator"
linters:
Expand Down Expand Up @@ -140,11 +140,8 @@ linters-settings:
extra-rules: true
dogsled:
max-blank-identifiers: 6
maligned:
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: true
require-specific: false
gosimple:
Expand Down

0 comments on commit 87ad512

Please sign in to comment.