Skip to content

Commit

Permalink
use 1.23 iter for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Aug 26, 2024
1 parent af3ea32 commit 2bfeb33
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-pb-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23

- name: Install go pkgs
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-tzpb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.21", "1.22"]
go: ["1.22", "1.23"]

steps:
- uses: actions/checkout@v4
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,34 @@ jobs:
run: |
deno fmt --check ./README.md
golangci:
name: golangci-lint
build:
strategy:
matrix:
go: ["1.21", "1.22"]
permissions:
contents: read
pull-requests: read
go: ["1.23"]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
go-version-file: go.mod

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m
build:
strategy:
matrix:
go: ["1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true

- name: Install go pkgs
run: |
make install
- name: Run coverage
run: go test -race -coverprofile=coverage.txt -covermode=atomic
run: go test -coverprofile=coverage.txt -covermode=atomic

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module github.com/ringsaturn/tzf

go 1.22
toolchain go1.23.0
go 1.23

require (
github.com/loov/hrtime v1.0.3
github.com/mitchellh/mapstructure v1.5.0
github.com/paulmach/orb v0.11.1
github.com/ringsaturn/go-cities.json v0.6.1
github.com/ringsaturn/go-cities.json v0.6.2
github.com/ringsaturn/polyf v0.2.2
github.com/ringsaturn/tzf-rel-lite v0.0.2024-a
github.com/tidwall/geojson v1.4.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKf
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/ringsaturn/go-cities.json v0.6.1 h1:37P320/yLo0IL4+hAQYPXNPNn8pvm497BCtE74EdFIA=
github.com/ringsaturn/go-cities.json v0.6.1/go.mod h1:RWApnQPG6nU558XXbY1try5mi9u9Hd667J6vr948VBo=
github.com/ringsaturn/go-cities.json v0.6.2 h1:7vtbP4JowdESbLFZkcTnCVooKmsGpdk73BT7mvBHSrw=
github.com/ringsaturn/go-cities.json v0.6.2/go.mod h1:RWApnQPG6nU558XXbY1try5mi9u9Hd667J6vr948VBo=
github.com/ringsaturn/polyf v0.2.2 h1:71ua1Giawwpb+bvqFelcZygup+0HFuV5hYLA+8YO2ZM=
github.com/ringsaturn/polyf v0.2.2/go.mod h1:0+PnAZooWRyH6ULFdxTC86pe15L4VT3e71CQVPG67CE=
github.com/ringsaturn/tzf-rel-lite v0.0.2024-a h1:olA5Zh7jE5tXhtHby2hFlZWo4nZJxIzTL7ctGFOa+Uw=
Expand Down
3 changes: 1 addition & 2 deletions tzf_default_finder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tzf_test
import (
"bytes"
"fmt"
"math/rand"
"runtime"
"testing"

Expand Down Expand Up @@ -55,7 +54,7 @@ func BenchmarkDefaultFinder_GetTimezoneName_Random_WorldCities(b *testing.B) {
bench := hrtesting.NewBenchmark(b)
defer bench.Report()
for bench.Next() {
p := gocitiesjson.Cities[rand.Intn(len(gocitiesjson.Cities))]
p := gocitiesjson.Random()
_ = defaultFinder.GetTimezoneName(p.Lng, p.Lat)
}
}
Expand Down
5 changes: 2 additions & 3 deletions tzf_fuzzy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package tzf_test

import (
"fmt"
"math/rand"
"testing"

"github.com/loov/hrtime/hrtesting"
Expand Down Expand Up @@ -31,7 +30,7 @@ func init() {

func TestFuzzySupports(t *testing.T) {
failCount := 0
for _, city := range gocitiesjson.Cities {
for city := range gocitiesjson.All(false) {
name := fuzzyFinder.GetTimezoneName(city.Lng, city.Lat)
if name == "" {
failCount += 1
Expand Down Expand Up @@ -76,7 +75,7 @@ func BenchmarkFuzzyFinder_GetTimezoneName_Random_WorldCities(b *testing.B) {
bench := hrtesting.NewBenchmark(b)
defer bench.Report()
for bench.Next() {
p := gocitiesjson.Cities[rand.Intn(len(gocitiesjson.Cities))]
p := gocitiesjson.Random()
_ = fuzzyFinder.GetTimezoneName(p.Lng, p.Lat)
}
}
Expand Down
3 changes: 1 addition & 2 deletions tzf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tzf_test
import (
"bytes"
"fmt"
"math/rand"
"runtime"
"testing"

Expand Down Expand Up @@ -48,7 +47,7 @@ func BenchmarkGetTimezoneName_Random_WorldCities(b *testing.B) {
bench := hrtesting.NewBenchmark(b)
defer bench.Report()
for bench.Next() {
p := gocitiesjson.Cities[rand.Intn(len(gocitiesjson.Cities))]
p := gocitiesjson.Random()
_ = finder.GetTimezoneName(p.Lng, p.Lat)
}
}
Expand Down

0 comments on commit 2bfeb33

Please sign in to comment.