Skip to content

Commit 26a5f17

Browse files
authored
bump min go version (#24)
* bump min go version * bump versions in ci * fix binary name * add coverage script
1 parent f2d872d commit 26a5f17

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

.github/workflows/lint-tests-release.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-go@v3
1818
with:
19-
go-version: "1.19"
19+
go-version: '~1.19.12'
20+
check-latest: true
2021
- name: golangci-lint
2122
uses: golangci/golangci-lint-action@v3
2223
with:
@@ -25,23 +26,22 @@ jobs:
2526
args: --timeout 10m
2627

2728
unit_test:
28-
name: Golang Unit Tests v${{ matrix.go }} (${{ matrix.os }})
29-
runs-on: ${{ matrix.os }}
30-
strategy:
31-
matrix:
32-
go: ["1.19"]
33-
os: [ubuntu-20.04]
29+
name: Golang Unit Tests
30+
runs-on: ubuntu-20.04
3431
steps:
3532
- uses: actions/checkout@v3
3633
- uses: actions/setup-go@v3
3734
with:
38-
go-version: ${{ matrix.go }}
35+
go-version: '~1.19.12'
36+
check-latest: true
3937
- run: go mod download
4038
shell: bash
4139
- run: ./scripts/build.sh ./build/precompile-evm
4240
shell: bash
4341
- run: ./scripts/build_test.sh -race
4442
shell: bash
43+
- run: ./scripts/coverage.sh
44+
shell: bash
4545

4646
e2e_test:
4747
name: e2e tests
@@ -54,7 +54,8 @@ jobs:
5454
- name: Set up Go
5555
uses: actions/setup-go@v3
5656
with:
57-
go-version: 1.19
57+
go-version: '~1.19.12'
58+
check-latest: true
5859
- name: Use Node.js
5960
uses: actions/setup-node@v3
6061
with:

scripts/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit
44
set -o nounset
55
set -o pipefail
66

7-
go_version_minimum="1.19.6"
7+
go_version_minimum="1.19.12"
88

99
go_version() {
1010
go version | sed -nE -e 's/[^0-9.]+([0-9.]+).+/\1/p'
@@ -23,7 +23,7 @@ version_lt() {
2323
}
2424

2525
if version_lt "$(go_version)" "$go_version_minimum"; then
26-
echo "SubnetEVM requires Go >= $go_version_minimum, Go $(go_version) found." >&2
26+
echo "Precompile-EVM requires Go >= $go_version_minimum, Go $(go_version) found." >&2
2727
exit 1
2828
fi
2929

@@ -44,10 +44,10 @@ if [[ $# -eq 1 ]]; then
4444
elif [[ $# -eq 0 ]]; then
4545
BINARY_PATH="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
4646
else
47-
echo "Invalid arguments to build subnet-evm. Requires zero (default location) or one argument to specify binary location."
47+
echo "Invalid arguments to build precompile-evm. Requires zero (default location) or one argument to specify binary location."
4848
exit 1
4949
fi
5050

5151
# Build Subnet EVM, which is run as a subprocess
52-
echo "Building Subnet-EVM version: $SUBNET_EVM_VERSION with Precompile at $BINARY_PATH"
52+
echo "Building Precompile-EVM with Subnet-EVM version: $SUBNET_EVM_VERSION at $BINARY_PATH"
5353
go build -ldflags "-X github.com/ava-labs/subnet-evm/plugin/evm.Version=$SUBNET_EVM_VERSION $STATIC_LD_FLAGS" -o "$BINARY_PATH" "plugin/"*.go

scripts/coverage.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
6+
7+
if [ ! -f "coverage.out" ]; then
8+
echo "no coverage file"
9+
exit 0
10+
fi
11+
12+
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
13+
echo "Current test coverage : $totalCoverage %"
14+
echo "========================================"
15+
16+
go tool cover -func=coverage.out

0 commit comments

Comments
 (0)