Skip to content

Commit eef3caa

Browse files
committed
add Makefile
Signed-off-by: Florian Lehner <dev@der-flo.net>
1 parent d4bb04d commit eef3caa

File tree

6 files changed

+83
-37
lines changed

6 files changed

+83
-37
lines changed

.github/workflows/staticcheck.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ on:
44
pull_request:
55
branches: [ '**' ]
66

7+
permissions:
8+
contents: read
9+
710
name: Go
811
jobs:
912
build:
1013
strategy:
1114
matrix:
12-
go-version: [1.24.x, 1.25.x]
15+
go-version: [1.25.x, 1.26.x]
1316
runs-on: ubuntu-latest
1417

1518
steps:
@@ -27,6 +30,25 @@ jobs:
2730
go test -race -count=5 ./...
2831
2932
- name: Shuffle tests
30-
if: startsWith(matrix.go-version, '1.25')
33+
if: startsWith(matrix.go-version, '1.26')
3134
run: |
3235
go test -shuffle=on ./...
36+
37+
general:
38+
strategy:
39+
matrix:
40+
target: ["build", "fmt", "lint", "test"]
41+
runner: ["ubuntu-latest", "ubuntu-24.04-arm"]
42+
runs-on: ${{ matrix.runner }}
43+
steps:
44+
- name: Check out code into the Go module directory
45+
uses: actions/checkout@v6
46+
47+
- name: Set up Go
48+
uses: actions/setup-go@v6
49+
with:
50+
go-version-file: 'go.mod'
51+
52+
- name: make ${{ matrix.target }}
53+
run: |
54+
make ${{ matrix.target }}

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY: build clean fmt lint test
2+
3+
build:
4+
go build
5+
6+
clean:
7+
go clean
8+
9+
fmt:
10+
go tool gofumpt -w .
11+
12+
lint:
13+
go tool staticcheck -checks=all -show-ignored -tests ./...
14+
15+
test:
16+
go test ./...

go.mod

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
module github.com/florianl/bluebox
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require github.com/cavaliergopher/cpio v1.0.1
66

77
require golang.org/x/sys v0.41.0
8+
9+
require (
10+
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
11+
github.com/google/go-cmp v0.7.0 // indirect
12+
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
13+
golang.org/x/mod v0.31.0 // indirect
14+
golang.org/x/sync v0.19.0 // indirect
15+
golang.org/x/tools v0.40.1-0.20260108161641-ca281cf95054 // indirect
16+
honnef.co/go/tools v0.7.0 // indirect
17+
mvdan.cc/gofumpt v0.9.2 // indirect
18+
)
19+
20+
tool (
21+
honnef.co/go/tools/cmd/staticcheck
22+
mvdan.cc/gofumpt
23+
)

go.sum

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1+
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
2+
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
13
github.com/cavaliergopher/cpio v1.0.1 h1:KQFSeKmZhv0cr+kawA3a0xTQCU4QxXF1vhU7P7av2KM=
24
github.com/cavaliergopher/cpio v1.0.1/go.mod h1:pBdaqQjnvXxdS/6CvNDwIANIFSP0xRKI16PX4xejRQc=
5+
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
6+
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
7+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
8+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
9+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
10+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
11+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
12+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
13+
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
14+
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
15+
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=
16+
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
17+
golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI=
18+
golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg=
19+
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
20+
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
321
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
422
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
23+
golang.org/x/tools v0.40.1-0.20260108161641-ca281cf95054 h1:CHVDrNHx9ZoOrNN9kKWYIbT5Rj+WF2rlwPkhbQQ5V4U=
24+
golang.org/x/tools v0.40.1-0.20260108161641-ca281cf95054/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
25+
golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=
26+
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
27+
honnef.co/go/tools v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU=
28+
honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc=
29+
mvdan.cc/gofumpt v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4=
30+
mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s=

main_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ func TestEmbedExec(t *testing.T) {
4646
}
4747

4848
for name, tc := range tests {
49-
name := name
50-
tc := tc
5149
t.Run(name, func(t *testing.T) {
5250
// Reset package global variables
5351
execs = []string{}
@@ -91,8 +89,6 @@ func TestEmbedEnvVar(t *testing.T) {
9189
},
9290
}
9391
for name, tc := range tests {
94-
name := name
95-
tc := tc
9692
t.Run(name, func(t *testing.T) {
9793
// Reset package global variables
9894
for k := range env {
@@ -107,7 +103,6 @@ func TestEmbedEnvVar(t *testing.T) {
107103
t.Fatalf("expected environment variables did not match. "+
108104
"Got: %#v\nExpected: %#v", env, tc.env)
109105
}
110-
111106
})
112107
}
113108
}

0 commit comments

Comments
 (0)