From d1b2e3b24c298cb33976345b0cc90b3b4f089843 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 8 May 2024 13:08:58 +0530 Subject: [PATCH] Upgrade dependecies and versions. --- .github/workflows/test.yml | 58 +++++++++++------------------------- go.mod | 10 +------ go.work | 9 ++++++ stores/goredis/go.mod | 20 +++++++++++++ stores/goredis/store.go | 2 +- stores/goredis/store_test.go | 4 +-- stores/memory/go.mod | 12 ++++++-- stores/redis/go.mod | 20 +++++++++---- stores/redis/store_test.go | 2 +- stores/securecookie/go.mod | 6 ++-- 10 files changed, 79 insertions(+), 64 deletions(-) create mode 100644 go.work create mode 100644 stores/goredis/go.mod diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d38d719..74bab5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,49 +1,27 @@ -name: tests +name: Run Tests -on: - push: - branches: - - master - pull_request: - branches: - - master +# Triggers the workflow on push or pull request events +on: [push, pull_request] jobs: test: strategy: - ## this will contain a matrix of all of the combinations - ## we wish to test again: matrix: - go-version: [1.13.x, 1.14.x, 1.15.x] - platform: [ubuntu-latest] + go: [ '1.18', '1.19', '1.20', '1.21' ] - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-20.04 + name: Go ${{ matrix.go }} Tests steps: - # Setup Go - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - ## Checks out the code locally. - - name: Checkout code - uses: actions/checkout@v2 - - # Install all the dependencies - - name: Install dependencies - run: | - go version - go get -u golang.org/x/lint/golint - go get -v -t -d ./... - - # Run vet & lint on the code - - name: Run vet & lint - run: | - go vet . - golint . - - # Run testing on the code - - name: Run testing - run: | - go test -v -cover `go list ./... | grep -v 'examples\|benchmarks'` + - uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go }} + + - name: Run all tests + run: go test -v github.com/vividvilla/simplesessions... + + - name: Run Coverage + run: go test -v -cover ./... diff --git a/go.mod b/go.mod index caab23a..a58de16 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,5 @@ module github.com/vividvilla/simplesessions -require ( - github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis v2.5.0+incompatible - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-redis/redis/v8 v8.5.0 - github.com/gomodule/redigo v1.8.3 // indirect - github.com/stretchr/testify v1.6.1 - github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect -) +require github.com/stretchr/testify v1.9.0 go 1.14 diff --git a/go.work b/go.work new file mode 100644 index 0000000..a0da523 --- /dev/null +++ b/go.work @@ -0,0 +1,9 @@ +go 1.18 + +use ( + . + ./stores/goredis + ./stores/redis + ./stores/securecookie + ./stores/memory +) diff --git a/stores/goredis/go.mod b/stores/goredis/go.mod new file mode 100644 index 0000000..9a5f4b2 --- /dev/null +++ b/stores/goredis/go.mod @@ -0,0 +1,20 @@ +module github.com/vividvilla/simplesessions/stores/goredis/v9 + +go 1.18 + +require ( + github.com/alicebob/miniredis/v2 v2.32.1 + github.com/redis/go-redis/v9 v9.5.1 + github.com/stretchr/testify v1.9.0 + github.com/vividvilla/simplesessions v0.2.0 +) + +require ( + github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/stores/goredis/store.go b/stores/goredis/store.go index 0695e8d..fc0825e 100644 --- a/stores/goredis/store.go +++ b/stores/goredis/store.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/go-redis/redis/v8" + "github.com/redis/go-redis/v9" "github.com/vividvilla/simplesessions" "github.com/vividvilla/simplesessions/conv" ) diff --git a/stores/goredis/store_test.go b/stores/goredis/store_test.go index 7e1cc30..6c1a8d2 100644 --- a/stores/goredis/store_test.go +++ b/stores/goredis/store_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/alicebob/miniredis" - "github.com/go-redis/redis/v8" + "github.com/alicebob/miniredis/v2" + "github.com/redis/go-redis/v9" "github.com/stretchr/testify/assert" "github.com/vividvilla/simplesessions" ) diff --git a/stores/memory/go.mod b/stores/memory/go.mod index 7093236..83b24d4 100644 --- a/stores/memory/go.mod +++ b/stores/memory/go.mod @@ -1,6 +1,14 @@ module github.com/vividvilla/simplesessions/stores/memory +go 1.18 + +require ( + github.com/stretchr/testify v1.9.0 + github.com/vividvilla/simplesessions v0.2.0 +) + require ( - github.com/stretchr/testify v1.2.2 - github.com/vividvilla/simplesessions v0.0.1 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/stores/redis/go.mod b/stores/redis/go.mod index 825ed2f..46108a4 100644 --- a/stores/redis/go.mod +++ b/stores/redis/go.mod @@ -1,10 +1,18 @@ module github.com/vividvilla/simplesessions/stores/redis +go 1.18 + +require ( + github.com/alicebob/miniredis/v2 v2.32.1 + github.com/gomodule/redigo v1.9.2 + github.com/stretchr/testify v1.9.0 + github.com/vividvilla/simplesessions v0.2.0 +) + require ( - github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 // indirect - github.com/alicebob/miniredis v0.0.0-20180903194238-a6a1e4126522 - github.com/gomodule/redigo v2.0.0+incompatible - github.com/stretchr/testify v1.2.2 - github.com/vividvilla/simplesessions v0.0.1 - github.com/yuin/gopher-lua v0.0.0-20180827083657-b942cacc89fe // indirect + github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/stores/redis/store_test.go b/stores/redis/store_test.go index 876ae15..dd10473 100644 --- a/stores/redis/store_test.go +++ b/stores/redis/store_test.go @@ -7,7 +7,7 @@ import ( "github.com/vividvilla/simplesessions" - "github.com/alicebob/miniredis" + "github.com/alicebob/miniredis/v2" "github.com/gomodule/redigo/redis" "github.com/stretchr/testify/assert" ) diff --git a/stores/securecookie/go.mod b/stores/securecookie/go.mod index ed06661..a0913b2 100644 --- a/stores/securecookie/go.mod +++ b/stores/securecookie/go.mod @@ -3,7 +3,7 @@ module github.com/vividvilla/simplesessions/stores/securecookie go 1.14 require ( - github.com/gorilla/securecookie v1.1.1 - github.com/stretchr/testify v1.2.2 - github.com/vividvilla/simplesessions v0.0.1 + github.com/gorilla/securecookie v1.1.2 + github.com/stretchr/testify v1.9.0 + github.com/vividvilla/simplesessions v0.2.0 )