Refactor github actions tests (#688)

This commit is contained in:
Fangjun Kuang
2024-03-22 21:22:42 +08:00
committed by GitHub
parent 1c77457d61
commit 24f437a6f1
42 changed files with 591 additions and 213 deletions

View File

@@ -9,6 +9,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'build-riscv64-linux-gnu.sh'
tags:
@@ -22,6 +23,7 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'sherpa-onnx/c-api/*'
- 'build-riscv64-linux-gnu.sh'
workflow_dispatch:
@@ -194,6 +196,8 @@ jobs:
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-${{ matrix.lib_type }}
mkdir $dst
cp -v $GITHUB_WORKSPACE/toolchain/sysroot/lib/ld-linux-riscv64xthead-lp64d.so.1 build-riscv64-linux-gnu/install/lib/
ls -lh build-riscv64-linux-gnu/install/lib
cp -a build-riscv64-linux-gnu/install/bin $dst/
@@ -219,6 +223,39 @@ jobs:
name: sherpa-onnx-linux-riscv64-shared
path: sherpa-onnx-*linux-riscv64-shared.tar.bz2
# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
with:
max_attempts: 20
timeout_seconds: 200
shell: bash
command: |
git config --global user.email "csukuangfj@gmail.com"
git config --global user.name "Fangjun Kuang"
rm -rf huggingface
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
cd huggingface
git lfs pull
mkdir -p riscv64
cp -v ../sherpa-onnx-*-shared.tar.bz2 ./riscv64
git status
git lfs track "*.bz2"
git add .
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-shared.tar.bz2"
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
- uses: actions/upload-artifact@v4
if: matrix.lib_type == 'shared'
with: