Skip to content

Commit

Permalink
all: run builds and tests with go1.18rc1 (#4143)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Feb 24, 2022
1 parent e125e7b commit 8f9a595
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.17]
go: [1.17, 1.18.0-rc1]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
stable: ${{ !contains(matrix.go, 'rc') }}
- run: ./gomod.sh
- run: ./gofmt.sh
- run: ./gogenerate.sh
Expand All @@ -29,21 +30,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.17, 1.16.7]
go: [1.17, 1.16.7, 1.18.0-rc1]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
stable: ${{ !contains(matrix.go, 'rc') }}
- run: go build ./...

test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.17, 1.16.7]
go: [1.17, 1.16.7, 1.18.0-rc1]
pg: [9.6.5, 10]
runs-on: ${{ matrix.os }}
services:
Expand Down Expand Up @@ -83,4 +85,5 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
stable: ${{ !contains(matrix.go, 'rc') }}
- run: go test -race -cover ./...
16 changes: 13 additions & 3 deletions staticcheck.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#! /bin/bash
set -e

gover=$(go version | { read _ _ gover _; printf $gover; })

version='2020.1.4'
if [[ "$gover" = "go1.18"* ]]; then
version='d5c28addcbbbafca0b9a0f9ad8957912e9371015'
fi

staticcheck='go run honnef.co/go/tools/cmd/staticcheck@'"$version"

printf "Running staticcheck $version...\n"
Expand All @@ -10,6 +16,10 @@ ls -d */ \
| egrep -v '^vendor|^docs' \
| xargs -I {} $staticcheck -tests=false -checks="all,-ST1003,-SA1019,-ST1005,-ST1000,-ST1016,-S1039,-ST1021,-ST1020,-ST1019,-SA4022" ./{}...


# Check horizon for unused exported symbols (relying on the fact that it should be self-contained)
$staticcheck -unused.whole-program -checks='U*' ./services/horizon/...
# Whole program unused checks were removed from staticcheck in newer versions,
# so this check is being sunset and will be removed once Go 1.18 is released and
# a proper release of staticcheck is released that supports it.
if [ "$version" = "2020.1.4" ]; then
# Check horizon for unused exported symbols (relying on the fact that it should be self-contained)
$staticcheck -unused.whole-program -checks='U*' ./services/horizon/...
fi

0 comments on commit 8f9a595

Please sign in to comment.