Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f1665e

Browse files
committed
no parameters
1 parent559aa48 commit3f1665e

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

‎.github/workflows/test-update.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ jobs:
2828
env:
2929
GH_TOKEN:${{ secrets.ARDUINOBOT_TOKEN }}
3030
run:|
31-
cd internal/testtools
32-
go test -v ./deb_test.go --arch amd64
31+
go test -v ./internal/testtools/deb_test.go --arch arm64

‎internal/testtools/deb_test.go‎

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ func TestStableToUnstable(t *testing.T) {
2525
majorTag:=majorTag(t,tagAppCli)
2626
_=minorTag(t,tagAppCli)
2727

28+
ls(t)
29+
2830
fmt.Printf("Updating from stable version %s to unstable version %s\n",tagAppCli,majorTag)
2931
fmt.Printf("Building local deb version %s\n",majorTag)
3032
buildDebVersion(t,majorTag,*arch)
@@ -173,13 +175,7 @@ func minorTag(t *testing.T, tag string) string {
173175
funcbuildDockerImage(t*testing.T,dockerfile,name,archstring) {
174176
t.Helper()
175177

176-
cmd:=exec.Command(
177-
"docker","buildx","build",
178-
"--platform","linux/amd64",
179-
"-t",name,
180-
"-f",dockerfile,
181-
".",
182-
)
178+
cmd:=exec.Command("docker","build","--build-arg","ARCH="+arch,"-t",name,"-f",dockerfile,".")
183179
// Capture both stdout and stderr
184180
varout bytes.Buffer
185181
varstderr bytes.Buffer
@@ -197,10 +193,6 @@ func buildDockerImage(t *testing.T, dockerfile, name, arch string) {
197193

198194
fmt.Println("✅ Docker build succeeded!")
199195
fmt.Println(out.String())
200-
// out, err := cmd.CombinedOutput()
201-
// if err != nil {
202-
// t.Fatalf("docker build failed: %v\nOutput:\n%s", err, string(out))
203-
// }
204196

205197
}
206198

@@ -288,3 +280,25 @@ func moveDeb(t *testing.T, startDir, targetDir, repo string, tagVersion string,
288280
panic(fmt.Errorf("failed to move deb file: %w",err))
289281
}
290282
}
283+
284+
funcls(t*testing.T) {
285+
t.Helper()
286+
cwd,err:=os.Getwd()
287+
iferr!=nil {
288+
fmt.Println("Error getting working directory:",err)
289+
return
290+
}
291+
292+
fmt.Println("Current directory:",cwd)
293+
fmt.Println("Listing all files and folders recursively:")
294+
295+
// Walk through all files and subdirectories
296+
err=filepath.Walk(cwd,func(pathstring,info os.FileInfo,errerror)error {
297+
iferr!=nil {
298+
returnerr
299+
}
300+
fmt.Println(path)
301+
returnnil
302+
})
303+
304+
}

‎internal/testtools/test.Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ RUN apt update && \
88

99
ARG ARCH=amd64
1010

11-
COPY build/stable/arduino-app-cli*.deb /tmp/stable.deb
12-
COPY build/arduino-app-cli*.deb /tmp/unstable.deb
13-
COPY build/stable/arduino-router*.deb /tmp/router.deb
11+
COPY build/stable/arduino-app-cli*_${ARCH}.deb /tmp/stable.deb
12+
COPY build/arduino-app-cli*_${ARCH}.deb /tmp/unstable.deb
13+
COPY build/stable/arduino-router*_${ARCH}.deb /tmp/router.deb
1414

1515
RUN apt update && apt install -y /tmp/stable.deb /tmp/router.deb \
1616
&& rm /tmp/stable.deb /tmp/router.deb \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp