Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: migrate long sims #6084

Merged
merged 64 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
eec5f46
add long sims
tac0turtle Apr 27, 2020
a394124
test git diff
tac0turtle Apr 27, 2020
522e67a
test change to go file
tac0turtle Apr 27, 2020
5bdb1ea
remove golang change
tac0turtle Apr 27, 2020
9b97e23
test out m inor if change
tac0turtle Apr 27, 2020
c49e8c2
make release sims only on releases
tac0turtle Apr 27, 2020
f727f5e
tey jobs syntax
tac0turtle Apr 27, 2020
b93e2b5
better syntax
tac0turtle Apr 27, 2020
a7dd49f
ahhh go change
tac0turtle Apr 27, 2020
b4d94ad
more go changes
tac0turtle Apr 27, 2020
eaac0ff
try some env variables
tac0turtle Apr 27, 2020
2da5651
try something janky
tac0turtle Apr 27, 2020
dbd7787
some more testing
tac0turtle Apr 28, 2020
9540d87
let the madness ensue
tac0turtle Apr 28, 2020
1401c1a
test
tac0turtle Apr 28, 2020
df2dc41
more testing
tac0turtle Apr 28, 2020
d91f883
aaaahhhhh
tac0turtle Apr 28, 2020
12bf568
aaaaaaaaaaa
tac0turtle Apr 28, 2020
3be4bd7
aaaaaaaaaaahhhhhhhhhh
tac0turtle Apr 28, 2020
5d58951
more
tac0turtle Apr 28, 2020
3828bab
more
tac0turtle Apr 28, 2020
8cfc8a3
env
tac0turtle Apr 28, 2020
67c4d55
too many
tac0turtle Apr 28, 2020
3ad6296
try another name
tac0turtle Apr 28, 2020
462c25c
try envs
tac0turtle Apr 28, 2020
ddcb7d9
some more
tac0turtle Apr 28, 2020
2fdfcd0
try something janky
tac0turtle Apr 28, 2020
305619b
fix script
tac0turtle Apr 28, 2020
63d46db
testsing
tac0turtle Apr 28, 2020
6bf9777
undo go changes
tac0turtle Apr 28, 2020
aa796da
idk
tac0turtle Apr 28, 2020
1597f1d
no run no go files
tac0turtle Apr 28, 2020
5b76a97
test go files change
tac0turtle Apr 28, 2020
21db897
should pass
tac0turtle Apr 28, 2020
daf5711
try in ""
tac0turtle Apr 28, 2020
94032be
try something else
tac0turtle Apr 28, 2020
30bbf9f
try something else
tac0turtle Apr 28, 2020
ee4a5dc
wrong way
tac0turtle Apr 28, 2020
7f86662
no go no run
tac0turtle Apr 28, 2020
fdbf465
no go no run
tac0turtle Apr 28, 2020
f363c18
maybe
tac0turtle Apr 28, 2020
0dc8d26
its alive
tac0turtle Apr 28, 2020
2b1245c
pass the feature to test-coverage
tac0turtle Apr 28, 2020
604de3f
Merge branch 'master' into marko/githubactions
tac0turtle Apr 28, 2020
305ee1a
test go mod changes
tac0turtle Apr 28, 2020
5c1f14f
Merge branch 'marko/githubactions' of https://github.com/cosmos/cosmo…
tac0turtle Apr 28, 2020
9c6feb1
check for changes in go.mod
tac0turtle Apr 28, 2020
5442797
migrate proto to GA
tac0turtle Apr 28, 2020
c6710c1
test proto ci
tac0turtle Apr 28, 2020
8918757
fix make cmd
tac0turtle Apr 28, 2020
8b42b97
try docker setup
tac0turtle Apr 28, 2020
16f61a6
tests exit 0
tac0turtle Apr 28, 2020
98e1045
remove go.mod change
tac0turtle Apr 28, 2020
d61f821
bring back exit 1
tac0turtle Apr 28, 2020
f17dd97
test one liner
tac0turtle Apr 28, 2020
ba619cc
make it pass and not skip
tac0turtle Apr 28, 2020
9bbb38f
test some changes
tac0turtle Apr 28, 2020
f47b0ae
no build on no changes
tac0turtle Apr 28, 2020
66dc73a
proto-breakage on circle
tac0turtle Apr 28, 2020
389a770
fix proto docker
tac0turtle Apr 28, 2020
8172754
remove proto from circle
tac0turtle Apr 28, 2020
80405fb
add comment for failure
tac0turtle Apr 28, 2020
0b567c8
add protobuf section to contributing
tac0turtle Apr 28, 2020
6573960
Merge branch 'master' into marko/githubactions
Apr 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,6 @@ jobs:
paths:
- ".git"

proto:
executor: protoc
steps:
- make:
target: protoc-gen-gocosmos
description: "Generate go plugin for protoc"
- make:
target: proto-gen proto-lint proto-check-breaking
description: "Lint and verify Protocol Buffer definitions"

test-sim-multi-seed-long:
executor: golang
steps:
- make:
target: test-sim-multi-seed-long
description: "Test multi-seed simulation (long)"

update-swagger-docs:
executor: golang
steps:
Expand All @@ -114,19 +97,6 @@ workflows:
tags:
only:
- /^v.*/
- test-sim-multi-seed-long:
requires:
- setup-dependencies
# These filters ensure that the long sim only runs during release
filters:
branches:
ignore: /.*/
tags:
only:
- /^v.*/
- proto:
requires:
- setup-dependencies
- build-docs:
context: docs-deployment-master
filters:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Proto check
on: [pull_request]
jobs:
proto-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: technote-space/get-diff-action@v1
id: git_diff
with:
SUFFIX_FILTER: .proto
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: lint
run: make proto-lint-docker
if: "env.GIT_DIFF != ''"
- name: check-breakage
run: make proto-check-breaking-docker
if: "env.GIT_DIFF != ''"
47 changes: 47 additions & 0 deletions .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release Sims
on:
push:
branches:
- /^v.*/

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-sims')"
steps:
- uses: actions/checkout@v2
- run: |
make build

install-runsim:
runs-on: ubuntu-latest
needs: build
steps:
- name: install runsim
run: |
export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v1
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary

test-sim-multi-seed-long:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
- name: test-sim-multi-seed-long
run: |
make test-sim-multi-seed-long
36 changes: 25 additions & 11 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
name: Sims
on: [pull_request]
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: Fail if no changes
# this is used to notify the other jobs that there are no changes and so they should not run
run: exit 1
if: "env.GIT_DIFF == ''"

cleanup-runs:
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-sims')"
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- run: |
make build

install-runsim:
runs-on: ubuntu-latest
needs: build
needs: [build, diff]
steps:
- uses: actions/setup-go@v2-beta
- name: install runsim
Expand All @@ -32,9 +50,8 @@ jobs:

test-sim-nondeterminism:
runs-on: ubuntu-latest
needs: [build, install-runsim]
needs: [build, install-runsim, diff]
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
Expand All @@ -46,9 +63,8 @@ jobs:

test-sim-import-export:
runs-on: ubuntu-latest
needs: [build, install-runsim]
needs: [build, install-runsim, diff]
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
Expand All @@ -60,9 +76,8 @@ jobs:

test-sim-after-import:
runs-on: ubuntu-latest
needs: [build, install-runsim]
needs: [build, install-runsim, diff]
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
Expand All @@ -74,9 +89,8 @@ jobs:

test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
needs: [build, install-runsim, diff]
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ jobs:
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- name: build
run: |
make build
if: "env.GIT_DIFF != ''"
- name: test & coverage report creation
run: |
go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
if: "env.GIT_DIFF != ''"
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
Expand All @@ -34,7 +43,9 @@ jobs:
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@v1
with:
file: ./coverage.txt # optional
fail_ci_if_error: true
if: "env.GIT_DIFF != ''"
25 changes: 16 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ contributors, the general procedure for contributing has been established:
4. Follow standard Github best practices: fork the repo, branch from the
HEAD of `master`, make some commits, and submit a PR to `master`
- For core developers working within the cosmos-sdk repo, to ensure a clear
ownership of branches, branches must be named with the convention
`{moniker}/{issue#}-branch-name`
ownership of branches, branches must be named with the convention
`{moniker}/{issue#}-branch-name`
5. Be sure to submit the PR in `Draft` mode submit your PR early, even if
it's incomplete as this indicates to the community you're working on
something and allows them to provide comments early in the development process
Expand Down Expand Up @@ -124,7 +124,7 @@ Please don't make Pull Requests from `master`.

## Dependencies

We use [Go 1.11 Modules](https://github.com/golang/go/wiki/Modules) to manage
We use [Go 1.14 Modules](https://github.com/golang/go/wiki/Modules) to manage
dependency versions.

The master branch of every Cosmos repository should just build with `go get`,
Expand All @@ -134,6 +134,14 @@ get away with telling people they can just `go get` our software.
Since some dependencies are not under our control, a third party may break our
build, in which case we can fall back on `go mod tidy -v`.

## Protobuf

We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use in Cosmos-SDK.

For linting and checking breaking changes, we use [buf](https://buf.build/). There are two options for linting and to check if your changes will cause a break. The first is that you can install [buf](https://buf.build/docs/installation) locally, the commands for running buf after installing are `make proto-lint` and the breaking changes check will be `make proto-check-breaking`. If you do not want to install buf and have docker installed already then you can use these commands `make proto-lint-docker` and `make proto-check-breaking-docker`.

To generate the protobuf stubs you must have `protoc` and `protoc-gen-gocosmos` installed. To install these tools run `make protoc` & `make protoc-gen-gocosmos`. After this step you will be able to run `make proto-gen` to generate the protobuf stubs.

## Testing

All repos should be hooked up to [CircleCI](https://circleci.com/).
Expand Down Expand Up @@ -232,11 +240,11 @@ releases will be based off of that release.
- create a PR into `master` containing ONLY the CHANGELOG.md updates
- tag and release `release/vX.XX.X`

## Code Owner Membership
## Code Owner Membership

In the ethos of open source projects, and out of necessity to keep the code
alive, the core contributor team will strive to permit special repo privileges
to developers who show an aptitude towards developing with this code base.
to developers who show an aptitude towards developing with this code base.

Several different kinds of privileges may be granted however most common
privileges to be granted are merge rights to either part of, or the entire the
Expand All @@ -247,17 +255,16 @@ potential new candidates as well as the potential for existing code-owners to
exit or "pass on the torch". This private meeting is to be a held as a
phone/video meeting. Subsequently at the end of the meeting, one of the existing
code owners should open a PR modifying the `CODEOWNERS` file. The other code
owners should then all approve this PR to publicly display their support.
owners should then all approve this PR to publicly display their support.

Only if unanimous consensus is reached among all the existing code-owners will
an invitation be extended to a new potential-member. Likewise, when an existing
member is suggested to be removed/or have their privileges reduced, the member
in question must agree on the decision for their removal or else no action
should be taken. If however, a code-owner is verifiably shown to intentionally
have had acted maliciously or grossly negligent, code-owner privileges may be
stripped with no prior warning or consent from the member in question.
stripped with no prior warning or consent from the member in question.

Earning this privilege should be considered to be no small feat and is by no
means guaranteed by any quantifiable metric. It is a symbol of great trust of
the community of this project.

the community of this project.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ LEDGER_ENABLED ?= true
BINDIR ?= $(GOPATH)/bin
SIMAPP = ./simapp
MOCKS_DIR = $(CURDIR)/tests/mocks
HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git
DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf

export GO111MODULE = on

Expand Down Expand Up @@ -255,6 +257,14 @@ proto-lint:
proto-check-breaking:
@buf check breaking --against-input '.git#branch=master'

proto-lint-docker:
@$(DOCKER_BUF) check lint --error-format=json
.PHONY: proto-lint

proto-check-breaking-docker:
@$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=master
.PHONY: proto-check-breaking-ci

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.33.1
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parent:
[![license](https://img.shields.io/github/license/cosmos/cosmos-sdk.svg)](https://github.com/cosmos/cosmos-sdk/blob/master/LICENSE)
[![LoC](https://tokei.rs/b1/github/cosmos/cosmos-sdk)](https://github.com/cosmos/cosmos-sdk)
[![API Reference](https://godoc.org/github.com/cosmos/cosmos-sdk?status.svg)](https://godoc.org/github.com/cosmos/cosmos-sdk)
[![Discord chat](https://img.shields.io/discord/669268347736686612.svg)](https://discord.gg/AzefAFd)

The Cosmos-SDK is a framework for building blockchain applications in Golang.
It is being used to build [`Gaia`](https://github.com/cosmos/gaia), the first implementation of the Cosmos Hub.
Expand Down
4 changes: 2 additions & 2 deletions codec/testdata/proto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ message Dog {
}

message Cat {
string moniker = 1;
int32 lives = 2;
string moniker = 1;
int32 lives = 2;
}