ci: upload artifacts on failure (#5987)
This commit is contained in:
parent
8f8ca6852a
commit
b26109c5dc
|
@ -94,61 +94,6 @@ jobs:
|
||||||
target: test-sim-multi-seed-long
|
target: test-sim-multi-seed-long
|
||||||
description: "Test multi-seed simulation (long)"
|
description: "Test multi-seed simulation (long)"
|
||||||
|
|
||||||
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')"
|
|
||||||
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
|
|
||||||
- run:
|
|
||||||
name: upload
|
|
||||||
command: bash <(curl -s https://codecov.io/bash) -f coverage.txt
|
|
||||||
|
|
||||||
update-swagger-docs:
|
update-swagger-docs:
|
||||||
executor: golang
|
executor: golang
|
||||||
steps:
|
steps:
|
||||||
|
@ -179,15 +124,9 @@ workflows:
|
||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v.*/
|
- /^v.*/
|
||||||
- test-cover:
|
|
||||||
requires:
|
|
||||||
- setup-dependencies
|
|
||||||
- proto:
|
- proto:
|
||||||
requires:
|
requires:
|
||||||
- setup-dependencies
|
- setup-dependencies
|
||||||
- upload-coverage:
|
|
||||||
requires:
|
|
||||||
- test-cover
|
|
||||||
- build-docs:
|
- build-docs:
|
||||||
context: docs-deployment-master
|
context: docs-deployment-master
|
||||||
filters:
|
filters:
|
||||||
|
|
|
@ -9,4 +9,4 @@ jobs:
|
||||||
uses: reviewdog/action-golangci-lint@v1
|
uses: reviewdog/action-golangci-lint@v1
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.github_token }}
|
github_token: ${{ secrets.github_token }}
|
||||||
reporter: github-pr-check
|
reporter: github-pr-review
|
||||||
|
|
|
@ -13,20 +13,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.head_commit.message, 'skip-sims')"
|
if: "!contains(github.event.head_commit.message, 'skip-sims')"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v2-beta
|
||||||
id: go
|
|
||||||
with:
|
|
||||||
go-version: 1.14
|
|
||||||
- name: Setup env for GO
|
|
||||||
# this is only used until the setup-go action is updated
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
|
||||||
echo "::set-env name=GO111MODULE::"on""
|
|
||||||
shell: bash
|
|
||||||
- name: install runsim
|
- name: install runsim
|
||||||
run: |
|
run: |
|
||||||
go get github.com/cosmos/tools/cmd/runsim@v1.0.0
|
export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~/go/bin
|
path: ~/go/bin
|
||||||
|
@ -36,16 +26,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: Build
|
needs: Build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v2-beta
|
||||||
id: go
|
|
||||||
with:
|
|
||||||
go-version: 1.14
|
|
||||||
- name: Setup env for GO
|
|
||||||
# this is only used until the setup-go action is updated
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
|
||||||
shell: bash
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
@ -59,16 +40,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: Build
|
needs: Build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v2-beta
|
||||||
id: go
|
|
||||||
with:
|
|
||||||
go-version: 1.14
|
|
||||||
- name: Setup env for GO
|
|
||||||
# this is only used until the setup-go action is updated
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
|
||||||
shell: bash
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
@ -82,16 +54,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: Build
|
needs: Build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v2-beta
|
||||||
id: go
|
|
||||||
with:
|
|
||||||
go-version: 1.14
|
|
||||||
- name: Setup env for GO
|
|
||||||
# this is only used until the setup-go action is updated
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
|
||||||
shell: bash
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
@ -105,16 +68,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: Build
|
needs: Build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v2-beta
|
||||||
id: go
|
|
||||||
with:
|
|
||||||
go-version: 1.14
|
|
||||||
- name: Setup env for GO
|
|
||||||
# this is only used until the setup-go action is updated
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
|
||||||
shell: bash
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
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
|
||||||
|
- name: test & coverage report creation
|
||||||
|
run: |
|
||||||
|
go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
|
||||||
|
- 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
|
||||||
|
- uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
file: ./coverage.txt # optional
|
||||||
|
fail_ci_if_error: true
|
|
@ -3,12 +3,11 @@ package rest
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/types/rest"
|
"github.com/cosmos/cosmos-sdk/types/rest"
|
||||||
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
|
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
|
||||||
|
|
|
@ -3,18 +3,16 @@ package rest
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/rest"
|
||||||
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
|
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
|
||||||
"github.com/cosmos/cosmos-sdk/x/distribution/client/common"
|
"github.com/cosmos/cosmos-sdk/x/distribution/client/common"
|
||||||
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/types/rest"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
Loading…
Reference in New Issue