Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,34 @@ jobs:
- name: Test
run: pnpm -C internal/tracking/worker test

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install tools
run: make tools
shell: bash
- name: Format check
run: make fmt-check
shell: bash
- name: Test
# Skip tests that depend on macOS Keychain / Linux keyring or Unix path semantics.
# These are covered by ubuntu-latest and macos-latest jobs.
# See https://github.com/steipete/gogcli/issues/395
run: >-
go test ./...
-skip 'TestAuth|TestListClientCredentials|TestReadClientCredentials|TestConfigExists|TestExpandPath|TestResolveKeyringBackendInfo|TestLoadSecrets_LegacyFallback'
shell: bash
- name: Lint
run: make lint
shell: bash
- name: Build
run: go build ./cmd/gog

darwin-cgo-build:
runs-on: macos-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions cmd/gog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"os"

"github.com/steipete/gogcli/internal/cmd"
_ "github.com/steipete/gogcli/internal/tzembed" // Embed IANA timezone database for Windows support
)

func main() {
Expand Down
37 changes: 37 additions & 0 deletions cmd/gog/tzdata_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package main

import (
"testing"
"time"

_ "github.com/steipete/gogcli/internal/tzembed" // Ensure tz database is embedded
)

// TestEmbeddedTZData verifies that the time/tzdata import in main.go
// successfully embeds the IANA timezone database. On macOS/Linux this
// passes regardless, but on Windows (where Go has no system tz database)
// it validates the actual fix. The test also guards against accidental
// removal of the time/tzdata import.
func TestEmbeddedTZData(t *testing.T) {
zones := []string{
"America/New_York",
"America/Los_Angeles",
"Europe/Berlin",
"Europe/London",
"Asia/Tokyo",
"Australia/Sydney",
"Pacific/Auckland",
"UTC",
}

for _, zone := range zones {
loc, err := time.LoadLocation(zone)
if err != nil {
t.Errorf("time.LoadLocation(%q) failed: %v (is time/tzdata imported?)", zone, err)
continue
}
if loc == nil {
t.Errorf("time.LoadLocation(%q) returned nil location", zone)
}
}
}
2 changes: 2 additions & 0 deletions internal/cmd/testmain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"os"
"path/filepath"
"testing"

_ "github.com/steipete/gogcli/internal/tzembed" // Embed IANA timezone database for Windows test support
)

func TestMain(m *testing.M) {
Expand Down
5 changes: 5 additions & 0 deletions internal/tzembed/embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Package tzembed forces embedding of the IANA timezone database
// so time.LoadLocation works on Windows in both binaries and tests.
package tzembed

import _ "time/tzdata" // Embeds IANA timezone database so time.LoadLocation works on Windows
Loading