ci(release test):hello check cpp & todo build
This commit is contained in:
28
.github/actions/test-helloworld/action.yml
vendored
28
.github/actions/test-helloworld/action.yml
vendored
@@ -1,11 +1,11 @@
|
|||||||
name: 'Test Hello World'
|
name: "Test Hello World"
|
||||||
description: 'Test Hello World with specific Go and module versions'
|
description: "Test Hello World with specific Go and module versions"
|
||||||
inputs:
|
inputs:
|
||||||
go-version:
|
go-version:
|
||||||
description: 'Go version being tested'
|
description: "Go version being tested"
|
||||||
required: true
|
required: true
|
||||||
mod-version:
|
mod-version:
|
||||||
description: 'Go module version to use'
|
description: "Go module version to use"
|
||||||
required: true
|
required: true
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@@ -24,12 +24,30 @@ runs:
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/goplus/lib/c"
|
"github.com/goplus/lib/c"
|
||||||
|
"github.com/goplus/lib/cpp/std"
|
||||||
)
|
)
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println("Hello, LLGo!")
|
fmt.Println("Hello, LLGo!")
|
||||||
println("Hello, LLGo!")
|
println("Hello, LLGo!")
|
||||||
c.Printf(c.Str("Hello, LLGo!\n"))
|
c.Printf(c.Str("Hello, LLGo!\n"))
|
||||||
|
c.Printf(std.Str("Hello LLGo by cpp/std.Str\n").CStr())
|
||||||
}
|
}
|
||||||
EOL
|
EOL
|
||||||
go mod tidy
|
go mod tidy
|
||||||
llgo run .
|
EXPECTED="Hello, LLGo!
|
||||||
|
Hello, LLGo!
|
||||||
|
Hello, LLGo!
|
||||||
|
Hello LLGo by cpp/std.Str"
|
||||||
|
OUTPUT=$(llgo run . 2>&1)
|
||||||
|
if echo "$OUTPUT" | grep -qF "$EXPECTED"; then
|
||||||
|
echo "Basic test passed"
|
||||||
|
else
|
||||||
|
echo "Basic test failed"
|
||||||
|
echo "Expected to contain:"
|
||||||
|
echo "$EXPECTED"
|
||||||
|
echo "Got:"
|
||||||
|
echo "$OUTPUT"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#TODO(zzy): Test embed targets, need dispatch target dir
|
||||||
|
|||||||
4
.github/workflows/release-build.yml
vendored
4
.github/workflows/release-build.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true'
|
if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true'
|
||||||
run: tar -czvf .sysroot/darwin.tar.gz -C .sysroot darwin
|
run: tar -czvf .sysroot/darwin.tar.gz -C .sysroot darwin
|
||||||
- name: Save Darwin sysroot cache
|
- name: Save Darwin sysroot cache
|
||||||
# if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true'
|
if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true'
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: .sysroot/darwin.tar.gz
|
path: .sysroot/darwin.tar.gz
|
||||||
@@ -171,7 +171,7 @@ jobs:
|
|||||||
ls -la release-llgo/
|
ls -la release-llgo/
|
||||||
echo "${{ github.workspace }}/release-llgo/bin/" >> $GITHUB_PATH
|
echo "${{ github.workspace }}/release-llgo/bin/" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Test Hello World with go.mod 1.21
|
- name: Test Hello World
|
||||||
uses: ./.github/actions/test-helloworld
|
uses: ./.github/actions/test-helloworld
|
||||||
with:
|
with:
|
||||||
go-version: ${{matrix.go-version}}
|
go-version: ${{matrix.go-version}}
|
||||||
|
|||||||
Reference in New Issue
Block a user