Support clang-tidy (#1034)

This commit is contained in:
Fangjun Kuang
2024-06-19 20:51:57 +08:00
committed by GitHub
parent 656b9fa1c8
commit a11c859971
63 changed files with 381 additions and 237 deletions

57
.github/workflows/clang-tidy.yaml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: clang-tidy
on:
push:
branches:
- master
- clang-tidy
paths:
- 'sherpa-onnx/csrc/**'
pull_request:
branches:
- master
paths:
- 'sherpa-onnx/csrc/**'
workflow_dispatch:
concurrency:
group: clang-tidy-${{ github.ref }}
cancel-in-progress: true
jobs:
clang-tidy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install clang-tidy
shell: bash
run: |
pip install clang-tidy
- name: Configure
shell: bash
run: |
mkdir build
cd build
cmake -DSHERPA_ONNX_ENABLE_PYTHON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
- name: Check with clang-tidy
shell: bash
run: |
cd build
make check

View File

@@ -184,6 +184,7 @@ jobs:
path: ./*.tar.bz2
- name: Publish to huggingface
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3

View File

@@ -133,6 +133,7 @@ jobs:
shell: bash
run: |
d=$PWD
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
pushd sherpa-onnx/flutter
dart pub get
@@ -159,6 +160,7 @@ jobs:
path: ./*.tar.bz2
- name: Publish to huggingface
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3