Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release/v0.39.1' into release/…
Browse files Browse the repository at this point in the history
…v0.39.1-celer.1
  • Loading branch information
Dominator008 committed Aug 11, 2020
2 parents 6893c8e + 89ceb62 commit 0152b34
Show file tree
Hide file tree
Showing 93 changed files with 1,583 additions and 901 deletions.
132 changes: 0 additions & 132 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,142 +74,10 @@ jobs:
paths:
- ".git"

test-sim-nondeterminism:
executor: golang
steps:
- make:
target: test-sim-nondeterminism
description: "Test individual module simulations"

test-sim-import-export:
executor: golang
steps:
- make:
target: test-sim-import-export
description: "Test application import/export simulation"

test-sim-after-import:
executor: golang
steps:
- make:
target: test-sim-after-import
description: "Test simulation after import"

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

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

test-cover:
executor: golang
parallelism: 4
steps:
- checkout
- restore_cache:
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: Run tests
command: |
export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')"
export GO111MODULE=on
mkdir -p /tmp/logs /tmp/workspace/profiles
for pkg in $(go list ./... | grep -v '/simulation' | circleci tests split); do
id=$(echo "$pkg" | sed 's|[/.]|_|g')
go test -mod=readonly -timeout 8m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
done
- persist_to_workspace:
root: /tmp/workspace
paths:
- "profiles/*"
- store_artifacts:
path: /tmp/logs

upload-coverage:
executor: golang
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: gather
command: |
echo "--> Concatenating profiles:"
ls /tmp/workspace/profiles/
echo "mode: atomic" > coverage.txt
for prof in $(ls /tmp/workspace/profiles/); do
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
done
- run:
name: filter out DONTCOVER
command: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
- run:
name: upload
command: bash <(curl -s https://codecov.io/bash) -f coverage.txt

update-swagger-docs:
executor: golang
steps:
- make:
target: update-swagger-docs
description: "Check if statik.go is up-to-date"

workflows:
version: 2
test-suite:
jobs:
- update-swagger-docs:
requires:
- setup-dependencies
- setup-dependencies:
# This filter enables the job for tags
filters:
tags:
only:
- /^v.*/
- test-sim-nondeterminism:
requires:
- setup-dependencies
- test-sim-import-export:
requires:
- setup-dependencies
- test-sim-after-import:
requires:
- setup-dependencies
- test-sim-multi-seed-short:
requires:
- setup-dependencies
- 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.*/
- test-cover:
requires:
- setup-dependencies
- upload-coverage:
requires:
- test-cover
- build-docs:
context: docs-deployment-master
filters:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint
on: [pull_request]
jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@master
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.28
args: --timeout 10m
github-token: ${{ secrets.github_token }}
46 changes: 46 additions & 0 deletions .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release Sims
on:
pull_request:
branches:
- "rc**"

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
122 changes: 122 additions & 0 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Sims
on: [pull_request]
jobs:
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 }}"

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:
- uses: actions/setup-go@v2-beta
- 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-nondeterminism:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/cache@v1
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
- name: test-sim-nondeterminism
run: |
make test-sim-nondeterminism
if: "env.GIT_DIFF != ''"

test-sim-import-export:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/cache@v1
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
- name: test-sim-import-export
run: |
make test-sim-import-export
if: "env.GIT_DIFF != ''"

test-sim-after-import:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/cache@v1
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
- name: test-sim-after-import
run: |
make test-sim-after-import
if: "env.GIT_DIFF != ''"

test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/cache@v1
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
- name: test-sim-multi-seed-short
run: |
make test-sim-multi-seed-short
if: "env.GIT_DIFF != ''"
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Code Coverage
on:
pull_request:
push:
branches:
- master
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'"

test-coverage-upload:
runs-on: ubuntu-latest
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')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
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 != ''"

0 comments on commit 0152b34

Please sign in to comment.