Skip to content

Commit 3cdad9b

Browse files
authored
Use manylinux in CI test (#692)
1 parent e60c897 commit 3cdad9b

10 files changed

+121
-86
lines changed

.github/workflows/aarch64-linux-gnu-shared.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ jobs:
179179

180180
# https://huggingface.co/docs/hub/spaces-github-actions
181181
- name: Publish to huggingface
182-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
182+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
183183
env:
184184
HF_TOKEN: ${{ secrets.HF_TOKEN }}
185185
uses: nick-fields/retry@v3

.github/workflows/aarch64-linux-gnu-static.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170

171171
# https://huggingface.co/docs/hub/spaces-github-actions
172172
- name: Publish to huggingface
173-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
173+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
174174
env:
175175
HF_TOKEN: ${{ secrets.HF_TOKEN }}
176176
uses: nick-fields/retry@v3

.github/workflows/android.yaml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,33 @@ jobs:
101101

102102
# https://huggingface.co/docs/hub/spaces-github-actions
103103
- name: Publish to huggingface
104-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
104+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
105105
env:
106106
HF_TOKEN: ${{ secrets.HF_TOKEN }}
107-
run: |
108-
git config --global user.email "csukuangfj@gmail.com"
109-
git config --global user.name "Fangjun Kuang"
107+
uses: nick-fields/retry@v3
108+
with:
109+
max_attempts: 20
110+
timeout_seconds: 200
111+
shell: bash
112+
command: |
113+
git config --global user.email "csukuangfj@gmail.com"
114+
git config --global user.name "Fangjun Kuang"
110115
111-
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
116+
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
112117
113-
cd huggingface
114-
git lfs pull
118+
cd huggingface
119+
git lfs pull
115120
116-
cp -v ../sherpa-onnx-*-android.tar.bz2 ./
121+
cp -v ../sherpa-onnx-*-android.tar.bz2 ./
117122
118-
git status
119-
git lfs track "*.bz2"
123+
git status
124+
git lfs track "*.bz2"
120125
121-
git add .
126+
git add .
122127
123-
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-android.tar.bz2"
128+
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-android.tar.bz2"
124129
125-
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
130+
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
126131
127132
- name: Release android libs
128133
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')

.github/workflows/arm-linux-gnueabihf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193

194194
# https://huggingface.co/docs/hub/spaces-github-actions
195195
- name: Publish to huggingface
196-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
196+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
197197
env:
198198
HF_TOKEN: ${{ secrets.HF_TOKEN }}
199199
uses: nick-fields/retry@v3

.github/workflows/build-xcframework.yaml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,31 +78,36 @@ jobs:
7878

7979
# https://huggingface.co/docs/hub/spaces-github-actions
8080
- name: Publish to huggingface
81-
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
81+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
8282
env:
8383
HF_TOKEN: ${{ secrets.HF_TOKEN }}
84-
run: |
85-
git config --global user.email "csukuangfj@gmail.com"
86-
git config --global user.name "Fangjun Kuang"
84+
uses: nick-fields/retry@v3
85+
with:
86+
max_attempts: 20
87+
timeout_seconds: 200
88+
shell: bash
89+
command: |
90+
git config --global user.email "csukuangfj@gmail.com"
91+
git config --global user.name "Fangjun Kuang"
8792
88-
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
93+
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
8994
90-
cd huggingface
91-
git lfs pull
95+
cd huggingface
96+
git lfs pull
9297
93-
cp -v ../sherpa-onnx-*-ios.tar.bz2 ./
98+
cp -v ../sherpa-onnx-*-ios.tar.bz2 ./
9499
95-
git status
96-
git lfs track "*.bz2"
100+
git status
101+
git lfs track "*.bz2"
97102
98-
git add .
103+
git add .
99104
100-
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-ios.tar.bz2"
105+
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-ios.tar.bz2"
101106
102-
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
107+
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
103108
104109
- name: Release xcframework
105-
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
110+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
106111
uses: svenstaro/upload-release-action@v2
107112
with:
108113
file_glob: true

.github/workflows/linux.yaml

Lines changed: 77 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -45,77 +45,66 @@ concurrency:
4545

4646
jobs:
4747
linux:
48-
name: ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.shared_lib }} ${{ matrix.gcc_version }}
48+
name: ${{ matrix.build_type }} ${{ matrix.shared_lib }}
4949
runs-on: ${{ matrix.os }}
5050
strategy:
5151
fail-fast: false
5252
matrix:
53-
os: [ubuntu-20.04, ubuntu-22.04]
53+
os: [ubuntu-latest]
5454
build_type: [Release, Debug]
5555
shared_lib: [ON, OFF]
56-
# see https://github.com/egor-tensin/setup-gcc
57-
# 7-11 for ubuntu 20.04
58-
# 9-12 for ubuntu 22.04
59-
gcc_version: ["7", "8", "9", "10", "11", "12", "13"]
60-
exclude:
61-
- os: ubuntu-20.04
62-
gcc_version: "12"
63-
- os: ubuntu-22.04
64-
gcc_version: "7"
65-
- os: ubuntu-22.04
66-
gcc_version: "8"
6756

6857
steps:
6958
- uses: actions/checkout@v4
7059
with:
7160
fetch-depth: 0
7261

73-
- name: Set up GCC ${{ matrix.gcc_version }}
74-
uses: egor-tensin/setup-gcc@v1
75-
with:
76-
version: ${{ matrix.gcc_version }}
77-
platform: x64
78-
79-
- name: Display gcc version ${{ matrix.gcc_version }}
62+
- name: Display PWD
8063
shell: bash
8164
run: |
82-
which gcc
83-
gcc --version
84-
85-
which g++
86-
g++ --version
65+
echo "pwd: $PWD"
66+
ls -lh
8767
88-
- name: ccache
89-
uses: hendrikmuhs/ccache-action@v1.2
68+
- name: Build sherpa-onnx
69+
uses: addnab/docker-run-action@v3
9070
with:
91-
key: ${{ matrix.os }}-${{ matrix.build_type }}-shared-${{ matrix.shared_lib }}-gcc-${{ matrix.gcc_version }}
71+
image: quay.io/pypa/manylinux2014_x86_64
72+
options: |
73+
--volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx
74+
shell: bash
75+
run: |
76+
uname -a
77+
gcc --version
78+
cmake --version
79+
cat /etc/*release
80+
id
81+
pwd
9282
93-
- name: Configure CMake
94-
shell: bash
95-
run: |
96-
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
97-
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
98-
cmake --version
83+
cd /home/runner/work/sherpa-onnx/sherpa-onnx
9984
100-
mkdir build
101-
cd build
102-
cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
85+
git clone --depth 1 https://github.com/alsa-project/alsa-lib
86+
pushd alsa-lib
87+
./gitcompile
88+
popd
10389
104-
- name: Build sherpa-onnx for ubuntu
105-
shell: bash
106-
run: |
107-
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
90+
export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
91+
export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs
92+
93+
mkdir build
94+
cd build
10895
109-
cd build
110-
make -j2
111-
make install
96+
cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
11297
113-
ls -lh lib
114-
ls -lh bin
98+
make -j2
99+
make install
100+
101+
ls -lh lib
102+
ls -lh bin
115103
116104
- name: Display dependencies of sherpa-onnx for linux
117105
shell: bash
118106
run: |
107+
sudo chown -R $USER ./build
119108
ls -lh build/bin
120109
ls -lh build/_deps/onnxruntime-src/lib/
121110
@@ -130,9 +119,8 @@ jobs:
130119
readelf -d build/bin/sherpa-onnx
131120
132121
- uses: actions/upload-artifact@v4
133-
if: matrix.shared_lib == 'OFF' && matrix.build_type == 'Release'
134122
with:
135-
name: release-static-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.shared_lib }}-${{ matrix.gcc_version }}
123+
name: release-${{ matrix.build_type }}-${{ matrix.shared_lib }}
136124
path: build/bin/*
137125

138126
- name: Test transducer kws
@@ -211,10 +199,17 @@ jobs:
211199
212200
- name: Copy files
213201
shell: bash
202+
if: matrix.build_type == 'Release'
214203
run: |
215204
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
216205
217-
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64
206+
if [[ ${{ matrix.shared_lib }} == 'ON' ]]; then
207+
suffix=shared
208+
else
209+
suffix=static
210+
fi
211+
212+
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-$suffix
218213
mkdir $dst
219214
220215
cp -a build/install/bin $dst/
@@ -225,16 +220,46 @@ jobs:
225220
226221
tar cjvf ${dst}.tar.bz2 $dst
227222
223+
- name: Publish to huggingface
224+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && matrix.build_type == 'Release'
225+
env:
226+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
227+
uses: nick-fields/retry@v3
228+
with:
229+
max_attempts: 20
230+
timeout_seconds: 200
231+
shell: bash
232+
command: |
233+
git config --global user.email "csukuangfj@gmail.com"
234+
git config --global user.name "Fangjun Kuang"
235+
236+
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
237+
238+
cd huggingface
239+
git lfs pull
240+
mkdir -p linux-x64
241+
242+
cp -v ../sherpa-onnx-*.tar.bz2 ./linux-x64
243+
244+
git status
245+
git lfs track "*.bz2"
246+
247+
git add .
248+
249+
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
250+
251+
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
252+
228253
- name: Release pre-compiled binaries and libs for linux x64
229-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' && matrix.gcc_version == '7'
254+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
230255
uses: svenstaro/upload-release-action@v2
231256
with:
232257
file_glob: true
233258
overwrite: true
234-
file: sherpa-onnx-*linux-x64.tar.bz2
259+
file: sherpa-onnx-*.tar.bz2
235260

236261
- uses: actions/upload-artifact@v4
237262
with:
238-
name: tts-generated-test-files-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.shared_lib }}-${{ matrix.gcc_version }}
263+
name: tts-generated-test-files-${{ matrix.build_type }}-${{ matrix.shared_lib }}
239264
path: tts
240265

.github/workflows/riscv64-linux.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ jobs:
225225

226226
# https://huggingface.co/docs/hub/spaces-github-actions
227227
- name: Publish to huggingface
228-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
228+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
229229
env:
230230
HF_TOKEN: ${{ secrets.HF_TOKEN }}
231231
uses: nick-fields/retry@v3

.github/workflows/windows-x64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
155155
# https://huggingface.co/docs/hub/spaces-github-actions
156156
- name: Publish to huggingface
157-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
157+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
158158
env:
159159
HF_TOKEN: ${{ secrets.HF_TOKEN }}
160160
uses: nick-fields/retry@v3

.github/workflows/windows-x86.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
158158
# https://huggingface.co/docs/hub/spaces-github-actions
159159
- name: Publish to huggingface
160-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' && github.event_name == 'workflow_dispatch')
160+
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
161161
env:
162162
HF_TOKEN: ${{ secrets.HF_TOKEN }}
163163
uses: nick-fields/retry@v3

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
22
project(sherpa-onnx)
33

4-
set(SHERPA_ONNX_VERSION "1.9.12")
4+
set(SHERPA_ONNX_VERSION "1.9.13")
55

66
# Disable warning about
77
#

0 commit comments

Comments
 (0)