Browse Source

ci: build for 32 bit, libs: fix overflow (#5700)

pull/5715/head
Marko 4 years ago
committed by Erik Grinaker
parent
commit
6c0d4070c2
4 changed files with 30 additions and 6 deletions
  1. +24
    -1
      .github/workflows/coverage.yml
  2. +3
    -3
      .github/workflows/tests.yml
  3. +2
    -1
      .goreleaser.yml
  4. +1
    -1
      libs/math/fraction.go

+ 24
- 1
.github/workflows/coverage.yml View File

@ -33,6 +33,29 @@ jobs:
name: "${{ github.sha }}-03"
path: ./pkgs.txt.part.03
build-linux:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goarch: ["arm", "amd64"]
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
with:
go-version: "^1.15.4"
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: install
run: GOOS=linux GOARCH=${{ matrix.goarch }} make build
if: "env.GIT_DIFF != ''"
tests:
runs-on: ubuntu-latest
needs: split-test-files
@ -43,7 +66,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.4'
go-version: "^1.15.4"
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:


+ 3
- 3
.github/workflows/tests.yml View File

@ -52,7 +52,7 @@ jobs:
test_abci_apps:
runs-on: ubuntu-latest
needs: Build
needs: build
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
@ -84,7 +84,7 @@ jobs:
test_abci_cli:
runs-on: ubuntu-latest
needs: Build
needs: build
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
@ -115,7 +115,7 @@ jobs:
test_apps:
runs-on: ubuntu-latest
needs: Build
needs: build
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2


+ 2
- 1
.goreleaser.yml View File

@ -8,7 +8,7 @@ builds:
- id: "Tendermint"
main: ./cmd/tendermint/main.go
ldflags:
- -s -w -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Version }}
- -s -w -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Version }}
env:
- CGO_ENABLED=0
goos:
@ -17,6 +17,7 @@ builds:
- windows
goarch:
- amd64
- arm
- arm64
checksum:


+ 1
- 1
libs/math/fraction.go View File

@ -42,7 +42,7 @@ func ParseFraction(f string) (Fraction, error) {
return Fraction{}, errors.New("denominator can't be 0")
}
if numerator > math.MaxInt64 || denominator > math.MaxInt64 {
return Fraction{}, fmt.Errorf("value overflow, numerator and denominator must be less than %d", math.MaxInt64)
return Fraction{}, fmt.Errorf("value overflow, numerator and denominator must be less than %d", int64(math.MaxInt64))
}
return Fraction{Numerator: numerator, Denominator: denominator}, nil
}

Loading…
Cancel
Save