Skip to content

Commit

Permalink
Merge branch 'main' into adam/directliquidation
Browse files Browse the repository at this point in the history
  • Loading branch information
toteki authored Aug 9, 2022
2 parents f693c13 + 43c0441 commit ad8b3a6
Show file tree
Hide file tree
Showing 22 changed files with 78 additions and 207 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,23 @@ jobs:
**/**.go
go.mod
go.sum
- name: Setup go
if: env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.18
cache: true
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}

- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}

- name: Compile
if: env.GIT_DIFF
run: |
go mod download
cd cmd/umeed
go build .
- uses: actions/upload-artifact@v3
if: env.GIT_DIFF
with:
name: umeed ${{ matrix.targetos }} ${{ matrix.arch }}
path: cmd/umeed/umeed
9 changes: 1 addition & 8 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Get Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true

- uses: actions/checkout@v3
- name: Setup tmate session
Expand Down
55 changes: 22 additions & 33 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,37 @@ on:
push:
branches:
- main
- release/**

jobs:
golangci:
name: Run golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 6
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.0
if: env.GIT_DIFF
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: actions/setup-go@v3
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
cache: true
- name: golangci-lint main
uses: golangci/golangci-lint-action@v3
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
- name: Run golangci-lint
version: latest
args: --timeout 8m
- name: golangci-lint pricefeeder
uses: golangci/golangci-lint-action@v3
if: env.GIT_DIFF
run: make lint
with:
version: latest
working-directory: price-feeder
args: --timeout 8m

super-linter:
name: Run super-linter
Expand All @@ -53,30 +54,18 @@ jobs:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

golangci-price-feeder:
buf-lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.0
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
price-feeder/go.mod
price-feeder/go.sum
- uses: actions/setup-go@v3
**/**.proto
- uses: bufbuild/buf-setup-action@v1
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
- uses: bufbuild/buf-lint-action@v1
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
- name: Lint price-feeder
if: env.GIT_DIFF
run: |
cd price-feeder && make lint
input: "proto"
11 changes: 2 additions & 9 deletions .github/workflows/price-feeder-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Get Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
cache: true
cache-dependency-path: price-feeder/go.sum
# Parse 'v*.*.*' semantic version from 'price-feeder/v*.*.*' and save to
# the $GITHUB_ENV environment variable.
- name: Set env
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.proto
- name: lint
run: make proto-lint
if: env.GIT_DIFF

breakage:
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Get Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
cache: true

- name: Set Env
run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV
Expand Down
33 changes: 3 additions & 30 deletions .github/workflows/simulations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Get Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}

- name: Install runsim
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0
Expand All @@ -51,27 +43,16 @@ jobs:
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true
- name: Test application non-determinism
if: env.GIT_DIFF
run: |
make test-sim-non-determinism
if: env.GIT_DIFF
test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.0
with:
Expand All @@ -83,15 +64,7 @@ jobs:
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true
- uses: actions/cache@v3
if: env.GIT_DIFF
with:
Expand Down
41 changes: 5 additions & 36 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,7 @@ jobs:
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true
- name: Test and Create Coverage Report
if: env.GIT_DIFF
run: |
Expand All @@ -81,15 +73,7 @@ jobs:
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true
- name: Build Docker Image
if: env.GIT_DIFF
run: |
Expand All @@ -113,15 +97,8 @@ jobs:
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true
cache-dependency-path: price-feeder/go.sum
- name: Test price-feeder
if: env.GIT_DIFF
run: |
Expand All @@ -143,15 +120,7 @@ jobs:
if: env.GIT_DIFF
with:
go-version: 1.18
- name: Get Go Cache
if: env.GIT_DIFF
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
cache: true
- name: Install Starport
if: env.GIT_DIFF
run: |
Expand Down
20 changes: 11 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,42 @@ run:

linters:
enable:
# - dupl
# - nestif
# - rowserrcheck -- enable when it will support generics
# - whitespace
# - wsl
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exportloopref
- goconst
- gocritic
- gofmt
- goimports
- revive
- gosec
- gosimple
- govet
- grouper
- ineffassign
- lll
- misspell
- nakedret
- nolintlint
- prealloc
- exportloopref
- revive
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- varcheck
- nolintlint
- asciicheck
# - whitespace
# - wsl

issues:
exclude-rules:
Expand All @@ -58,8 +63,6 @@ issues:
linters-settings:
dogsled:
max-blank-identifiers: 3
golint:
min-confidence: 0
revive:
# Sets the default failure confidence.
# This means that linting errors with less than 0.8 confidence will be ignored.
Expand All @@ -71,4 +74,3 @@ linters-settings:
allow-unused: false
allow-leading-space: true
require-explanation: false
require-specific: false
Loading

0 comments on commit ad8b3a6

Please sign in to comment.