From 3be12dce44a9ff79962200d935607e68db080e30 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Tue, 9 Sep 2025 13:44:11 +0800 Subject: [PATCH] ci:test helloword with embed target --- .github/actions/test-helloworld/action.yml | 14 ++++++++++++-- .goreleaser.yaml | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-helloworld/action.yml b/.github/actions/test-helloworld/action.yml index 6ef57444..9020e788 100644 --- a/.github/actions/test-helloworld/action.yml +++ b/.github/actions/test-helloworld/action.yml @@ -38,7 +38,7 @@ runs: Hello, LLGo! Hello, LLGo! Hello LLGo by cpp/std.Str" - OUTPUT=$(llgo run -v . 2>&1 | tee /dev/stderr) + OUTPUT=$(llgo run . 2>&1 | tee /dev/stderr) if echo "$OUTPUT" | grep -qF "$EXPECTED"; then echo "Basic test passed" else @@ -50,4 +50,14 @@ runs: exit 1 fi - #TODO(zzy): Test embed targets, need dispatch target dir + cd ../.. + mkdir -p _test/emb && cd _test/emb + cat > main.go << 'EOL' + package main + + func main() { + } + EOL + llgo build -v -target esp32-coreboard-v2 -o demo.out . + test -f demo.out.elf && echo "ESP32 cross-compilation test passed: demo.out.elf generated" + exit $? diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 681e422b..2169ef1d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -91,6 +91,7 @@ archives: - LICENSE - README.md - runtime + - targets - src: ".sysroot/{{.Os}}/{{.Arch}}/crosscompile/clang" dst: crosscompile/clang info: