Skip to content

Commit beda70a

Browse files
committed
fix(ci): skip Unix perm test on Windows, pin golangci-lint to v2.11.4
1 parent aecd3e3 commit beda70a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ jobs:
1818

1919
- uses: golangci/golangci-lint-action@v6
2020
with:
21-
version: latest
22-
install-mode: goinstall
21+
version: v2.11.4

internal/config/config_test.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package config
33
import (
44
"os"
55
"path/filepath"
6+
"runtime"
67
"testing"
78
)
89

@@ -27,13 +28,15 @@ func TestSaveAndLoad(t *testing.T) {
2728
t.Fatal(err)
2829
}
2930

30-
// File must be owner-only
31-
info, err := os.Stat(Path())
32-
if err != nil {
33-
t.Fatal(err)
34-
}
35-
if perm := info.Mode().Perm(); perm != 0o600 {
36-
t.Errorf("config file perms = %o, want 0600", perm)
31+
// File must be owner-only (Unix only — Windows has no chmod)
32+
if runtime.GOOS != "windows" {
33+
info, err := os.Stat(Path())
34+
if err != nil {
35+
t.Fatal(err)
36+
}
37+
if perm := info.Mode().Perm(); perm != 0o600 {
38+
t.Errorf("config file perms = %o, want 0600", perm)
39+
}
3740
}
3841

3942
loaded, err := Load()
@@ -60,6 +63,9 @@ func TestRequireAPIKey(t *testing.T) {
6063
func TestPath(t *testing.T) {
6164
home := t.TempDir()
6265
t.Setenv("HOME", home)
66+
if runtime.GOOS == "windows" {
67+
t.Skip("HOME env var not used for config path on Windows")
68+
}
6369
want := filepath.Join(home, ".supermodel", "config.yaml")
6470
if got := Path(); got != want {
6571
t.Errorf("Path() = %q, want %q", got, want)

0 commit comments

Comments
 (0)