Skip to content

Commit

Permalink
Merge branch 'main' into merge-main
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-wayne2 authored Aug 1, 2022
2 parents 0af0802 + dc95e33 commit 46cf0a8
Show file tree
Hide file tree
Showing 323 changed files with 8,894 additions and 7,475 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests E2E
# Tests Race workflow runs unit tests with the race detector
# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed
on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: technote-space/get-diff-action@v6.1.0
id: git_diff
with:
PATTERNS: |
**/**.go
**/go.mod
**/go.sum
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Build
if: env.GIT_DIFF
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build


test-e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: e2e tests
if: env.GIT_DIFF
run: |
cd tests/e2e && go test ./... -mod=readonly -timeout 30m -race -tags='e2e'
46 changes: 46 additions & 0 deletions .github/workflows/fork-cherry-pick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
#Set to trigger on every merge to main, not just a closed PR.
workflow_dispatch:
pull_request_target:
branches:
- main
types: ["closed"]

jobs:
cherry_pick:
runs-on: ubuntu-latest
name: Cherry pick into main
if: github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Create PR Patch Branch
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "${GITHUB_ACTOR}" #Configs have to be set for pushing the cherry-picked changes onto fork pr-patch branch.
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote add upstream https://github.com/cosmos/cosmos-sdk.git
git fetch --all # Get the latest code
git checkout -b pr-patch upstream/main # Create new branch based on main branch
git cherry-pick ${{github.event.pull_request.head.sha}} # Cherry pick the latest commit of PR
git push -u origin pr-patch # Push your changes to the remote branch
- name: Autocreate PR
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl --request POST \
--url https://api.github.com/repos/cosmos/cosmos-sdk/pulls \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated PR for commit: ${{github.event.pull_request.head.sha}}",
"body":"Please merge these awesome changes in!",
"head":"${{github.event.pull_request.user.login}}:pr-patch",
"base":"main"
}' \
--fail
2 changes: 1 addition & 1 deletion .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.6.0
- uses: bufbuild/buf-setup-action@v1.7.0
- uses: bufbuild/buf-push-action@v1
with:
input: "proto"
Expand Down
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@v3
- uses: bufbuild/buf-setup-action@v1.6.0
- uses: bufbuild/buf-setup-action@v1.7.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.6.0
- uses: bufbuild/buf-setup-action@v1.7.0
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
138 changes: 0 additions & 138 deletions .github/workflows/test-race.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
if: env.GIT_DIFF
- name: test & coverage report creation
run: |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='norace ledger test_ledger_mock'
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'
if: env.GIT_DIFF
- uses: actions/upload-artifact@v3
with:
Expand Down
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
Expand All @@ -23,11 +22,9 @@ linters:
- nakedret
- nolintlint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused

issues:
Expand Down
Loading

0 comments on commit 46cf0a8

Please sign in to comment.