Skip to content

Commit

Permalink
Builds with Go 1.18, but tests with 1.17, 1.18 and 1.19
Browse files Browse the repository at this point in the history
This uses a test matrix to ensure the floor version of Mosn is two
behind latest Go, even if one behind latest (currently 1.18) is used to
build binaries.

See mosn/mosn#2153

Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt committed Nov 2, 2022
1 parent 1e45865 commit 4ec68f9
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 2,177 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/ci.yml
Expand Up @@ -10,23 +10,47 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
uses: reviewdog/action-golangci-lint@v2
with:
golangci_lint_flags: --timeout=10m --tests=false --skip-dirs=example

test:
name: Test
runs-on: ubuntu-latest
# A matrix proves the supported range of Go versions work. This must always
# include the floor Go version policy of Mosn and the current Go version.
# Mosn's floor Go version for libraries is two behind current, e.g. if Go
# supports 1.19 and 1.20, Mosn libraries must work on 1.18, 1.19 and 1.20.
#
# A floor version is required to ensure Mosn can receive security patches.
# Without one, dependencies become locked to an old version of Go, which
# itself receives no security patch updates.
#
# Mosn's binary is built with Go's floor version, e.g. if Go supports 1.19
# and 1.20, Mosn will build any downloadable executables with 1.19.
#
# Even if mosn works with a Go version below its supported floor, users
# must not depend on this. Mosn and its library dependencies are free to
# use features in the supported floor Go version at any time. This remains
# true even if mosn library dependencies are not eagerly updated.
strategy:
matrix:
go-version:
- "1.19" # Current Go version
- "1.18"
- "1.17" # Floor Go version of Mosn == current - 2

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v3
with:
go-version: 1.14.13

- name: Check out code
uses: actions/checkout@v1
go-version: ${{ matrix.go-version }}
cache: true

- name: holmes test
run: make test
Expand Down
18 changes: 11 additions & 7 deletions example/gcheap/go.mod
Expand Up @@ -4,18 +4,22 @@ go 1.17

require (
mosn.io/holmes v0.0.0-20220125114618-8cb365eb42ac
mosn.io/pkg v0.0.0-20220308091858-ea728aacbe63
mosn.io/pkg v1.2.2
)

require (
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/go-syslog v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/shirou/gopsutil v3.20.11+incompatible // indirect
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/sys v0.1.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
mosn.io/api v0.0.0-20210204052134-5b9a826795fd // indirect
mosn.io/api v1.1.1-0.20221020052648-537dd3d52055 // indirect
)

replace mosn.io/holmes => ../../
760 changes: 34 additions & 726 deletions example/gcheap/go.sum

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion example/pyroscope_rideshare/go.mod
@@ -1,7 +1,23 @@
module rideshare

go 1.14
go 1.17

require mosn.io/holmes v1.1.0

require (
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/go-syslog v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/sys v0.1.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
mosn.io/api v1.1.1-0.20221020052648-537dd3d52055 // indirect
mosn.io/pkg v1.2.2 // indirect
)

replace mosn.io/holmes => ../../

0 comments on commit 4ec68f9

Please sign in to comment.