Skip to content

Commit ff73555

Browse files
committed
Try to test against Windows
Adds Windows to the test matrix. We'll see what breaks. For creack/pty, we need to use the currently-unmerged change for Windows support.
1 parent 0a472a3 commit ff73555

33 files changed

+74
-10
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Added
2+
body: Windows support.
3+
time: 2024-09-07T16:16:36.18073-07:00

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
# Don't magically change line endings by default,
2+
# but always use LF in test scripts.
3+
#
4+
# Ref:
5+
# - https://github.com/golang/go/blob/807e01db4840e25e4d98911b28a8fa54244b8dfa/.gitattributes
6+
# - https://github.com/rogpeppe/go-internal/pull/106
7+
* -text
8+
*.txt text eol=lf
9+
110
*.png filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
name: Test (${{ matrix.os}})
4141
strategy:
4242
matrix:
43-
os: ["ubuntu-latest"] # TODO: ["windows-latest"]
43+
os: ["ubuntu-latest", "windows-latest"]
4444
steps:
4545
- uses: actions/checkout@v4
4646
- name: Set up Go

.goreleaser.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ builds:
66
- CGO_ENABLED=0
77
main: .
88
binary: gs
9-
goos: [darwin, linux]
9+
goos: [darwin, linux, windows]
1010
goarch: [amd64, arm64, arm]
1111
goarm: [5, 6, 7]
1212
ldflags: '-s -w -X main._version={{.Version}}'
1313
ignore:
1414
- goos: darwin
1515
goarch: arm
16+
- goos: windows
17+
goarch: arm
1618
flags:
1719
- -trimpath
1820

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ MOCKGEN = bin/mockgen
1818
REQUIREDFIELD = bin/requiredfield
1919
TOOLS = $(MOCKGEN) $(GS)
2020

21-
# Non-test Go files.
22-
GO_SRC_FILES = $(shell find . \
23-
-path '*/.*' -prune -o \
24-
'(' -type f -a -name '*.go' -a -not -name '*_test.go' ')' -print)
25-
2621
.PHONY: all
2722
all: build lint test
2823

@@ -73,9 +68,12 @@ generate-lint: $(TOOLS)
7368
git diff --exit-code || \
7469
(echo "'go generate' changed files" && false)
7570

76-
$(GS): $(GO_SRC_FILES) go.mod
71+
$(GS): _always
7772
go install go.abhg.dev/gs
7873

74+
.PHONY: _always
75+
_always:
76+
7977
$(MOCKGEN): go.mod
8078
go install go.uber.org/mock/mockgen
8179

internal/git/gittest/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ func DefaultConfig() Config {
1111
return Config{
1212
"init.defaultBranch": "main",
1313
"alias.graph": "log --graph --decorate --oneline",
14+
"core.autocrlf": "false",
1415
}
1516
}
1617

testdata/script/auth_insecure_storage.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ gs auth login --forge=shamhub
4141
cmp stderr $WORK/golden/login-secure.stderr
4242

4343
-- golden/login.stderr --
44-
WRN Storing secrets in plain text at $WORK/home/.config/git-spice/secrets.json. Be careful!
44+
WRN Storing secrets in plain text at $WORK${/}home${/}.config${/}git-spice${/}secrets.json. Be careful!
4545
INF shamhub: successfully logged in
4646
-- golden/login-secure.stderr --
4747
INF shamhub: successfully logged in

testdata/script/auth_prompt_forge.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# auth operations prompt for forge if it cannot be guessed
22

3+
[!unix] skip # pending github.com/creack/pty/pull/155
4+
35
as 'Test <[email protected]>'
46
at '2024-07-01T04:30:32Z'
57

testdata/script/branch_checkout_prompt.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# branch checkout with lots of branches
22
# and no argument prompts for branch name.
33

4+
[!unix] skip # pending github.com/creack/pty/pull/155
5+
46
as 'Test <[email protected]>'
57
at '2024-03-30T14:59:32Z'
68

testdata/script/branch_checkout_prompt_trunk.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# branch checkout prompt shows trunk
22
# if it's not checked out.
33

4+
[!unix] skip # pending github.com/creack/pty/pull/155
5+
46
as 'Test <[email protected]>'
57
at '2024-06-03T20:06:07Z'
68

0 commit comments

Comments
 (0)