Merge pull request #625 from aofei/opt-deps

ci: install further optional dependencies for demos
This commit is contained in:
xushiwei
2024-07-31 13:00:34 +08:00
committed by GitHub
2 changed files with 17 additions and 9 deletions

View File

@@ -58,6 +58,15 @@ jobs:
) )
sudo apt-get install -y "${opt_deps[@]}" sudo apt-get install -y "${opt_deps[@]}"
- name: Install further optional dependencies for demos
run: |
wget -P ./_demo/llama2-c https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin
py_deps=(
numpy # for github.com/goplus/llgo/py/numpy
torch # for github.com/goplus/llgo/py/torch
)
pip3 install --break-system-packages "${py_deps[@]}"
- name: Clang information - name: Clang information
run: | run: |
echo $PATH echo $PATH
@@ -73,27 +82,25 @@ jobs:
run: go build -v ./... run: go build -v ./...
- name: Test - name: Test
if: matrix.os != 'macos-latest' if: ${{!startsWith(matrix.os, 'macos')}}
run: go test -v ./... run: go test -v ./...
- name: Test with coverage - name: Test with coverage
if: matrix.os == 'macos-latest' if: startsWith(matrix.os, 'macos')
run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
- name: Install - name: Install
run: go install ./... run: go install ./...
- name: LLGO tests - name: LLGO tests
if: matrix.os != 'ubuntu-latest' if: ${{!startsWith(matrix.os, 'ubuntu')}}
run: | run: |
echo "Test result on ${{matrix.os}} with LLVM ${{matrix.llvm}}" > result.md echo "Test result on ${{matrix.os}} with LLVM ${{matrix.llvm}}" > result.md
bash .github/workflows/test_llgo.sh bash .github/workflows/test_llgo.sh
- name: Test _demo and _pydemo - name: Test demos
run: | continue-on-error: true
set +e run: bash .github/workflows/test_demo.sh
bash .github/workflows/test_demo.sh
exit 0
- name: Show test result - name: Show test result
run: cat result.md run: cat result.md

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
# llgo run subdirectories under _demo and _pydemo # llgo run subdirectories under _demo and _pydemo
total=0 total=0
@@ -8,7 +9,7 @@ for d in ./_demo/* ./_pydemo/*; do
total=$((total+1)) total=$((total+1))
if [ -d "$d" ]; then if [ -d "$d" ]; then
echo "Testing $d" echo "Testing $d"
if ! llgo run "$d"; then if ! (cd "$d" && llgo run .); then
echo "FAIL" echo "FAIL"
failed=$((failed+1)) failed=$((failed+1))
failed_cases="$failed_cases\n* :x: $d" failed_cases="$failed_cases\n* :x: $d"