Skip to content

Commit

Permalink
Refactor CI
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Mar 21, 2024
1 parent c8770ae commit 718d185
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/aarch64-linux-gnu-shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
pull_request:
branches:
Expand All @@ -21,6 +22,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'

workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/aarch64-linux-gnu-static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
pull_request:
branches:
Expand All @@ -21,6 +22,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'

workflow_dispatch:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ on:
- 'build-android*.sh'

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: android-${{ github.ref }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/apk-kws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: apk-kws

on:
push:
branches:
- apk-kws
tags:
- '*'

Expand All @@ -17,7 +15,7 @@ permissions:
contents: write

jobs:
apk:
apk_kws:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/apk-speaker-identification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: apk-speaker-identification

on:
push:
branches:
- apk
tags:
- '*'

Expand All @@ -17,7 +15,7 @@ permissions:
contents: write

jobs:
apk_tts:
apk_speaker_identification:
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
runs-on: ${{ matrix.os }}
name: apk for tts ${{ matrix.index }}/${{ matrix.total }}
Expand Down Expand Up @@ -84,18 +82,7 @@ jobs:
ls -lh ./apks/
du -h -d1 .
# - name: Release
# uses: svenstaro/upload-release-action@v2
# with:
# file_glob: true
# file: ./apks/*.apk
# overwrite: true
# repo_name: k2-fsa/sherpa-onnx
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
# tag: speaker-recongition-models

- name: Publish to huggingface
if: true
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/apk-tts-engine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: apk-tts-engine

on:
push:
branches:
- apk-tts
tags:
- '*'

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/apk-tts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: apk-tts

on:
push:
branches:
- apk-tts
- apk
tags:
- '*'

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/apk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: apk

on:
push:
branches:
- apk
tags:
- '*'

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/arm-linux-gnueabihf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
tags:
- '*'
Expand All @@ -21,6 +22,7 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'

workflow_dispatch:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/build-wheels-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-wheels-aarch64

on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
Expand Down Expand Up @@ -61,10 +59,8 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- name: Publish to huggingface
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-wheels-armv7l.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-wheels-armv7l

on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build-wheels-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-wheels-linux

on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
Expand All @@ -12,7 +10,7 @@ env:
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1

concurrency:
group: build-wheels-${{ github.ref }}
group: build-wheels-linux-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -84,6 +82,7 @@ jobs:
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
shell: bash
with:
max_attempts: 20
timeout_seconds: 200
Expand Down Expand Up @@ -112,23 +111,25 @@ jobs:
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
twine upload ./wheelhouse/*.whl
- name: Build sdist
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
shell: bash
run: |
python3 setup.py sdist
ls -l dist/*
- name: Publish sdist to PyPI
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
shell: bash
run: |
twine upload dist/sherpa-onnx-*.tar.gz
7 changes: 2 additions & 5 deletions .github/workflows/build-wheels-macos-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-wheels-macos-arm64

on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
Expand All @@ -16,7 +14,7 @@ concurrency:
cancel-in-progress: true

jobs:
build_wheels:
build_wheels_macos_arm64:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -34,6 +32,7 @@ jobs:
if: matrix.python-version == 'cp37'
uses: pypa/[email protected]
env:
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64'"
CIBW_ARCHS: "arm64"
CIBW_BUILD_VERBOSITY: 3
Expand All @@ -58,8 +57,6 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-wheels-macos-x64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

jobs:
build_wheels:
build_wheels_macos_x64:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -41,6 +41,7 @@ jobs:

# Don't repair macOS wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""

- name: Build wheels
if: matrix.python-version != 'cp37'
uses: pypa/[email protected]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-wheels-win32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: build-wheels-win32

on:
push:
branches:
- wheel
tags:
- '*'
workflow_dispatch:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-wheels-win64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/build-xcframework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ on:
push:
branches:
- master
- xcframework
paths:
- './build-ios.sh'
- '.github/workflows/build-xcframework.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
tags:
- '*'
pull_request:
branches:
- master
paths:
- './build-ios.sh'
- '.github/workflows/build-xcframework.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'

workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/mfc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'cmake/**'
- 'mfc-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
pull_request:
branches:
- master
Expand All @@ -21,6 +22,7 @@ on:
- 'cmake/**'
- 'mfc-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'

workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/riscv64-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10","3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.9"
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/swift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,28 @@ on:
push:
branches:
- master
paths:
- './build-swift-macos.sh'
- '.github/workflows/swift.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'swift-api-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- '.github/scripts/test-swift.sh'

pull_request:
branches:
- master
paths:
- './build-swift-macos.sh'
- '.github/workflows/swift.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'swift-api-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
- '.github/scripts/test-swift.sh'

workflow_dispatch:

Expand Down
Loading

0 comments on commit 718d185

Please sign in to comment.