Repository navigation
ci: cover timestamp and Paraformer hotword regressions #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate NumPy compatibility | |
| on: | |
| pull_request: | |
| paths: | |
| - "setup.py" | |
| - "funasr/__init__.py" | |
| - "funasr/cli.py" | |
| - "tests/test_cli.py" | |
| - "funasr/auto/auto_model.py" | |
| - "funasr/utils/load_utils.py" | |
| - "funasr/utils/timestamp_tools.py" | |
| - "funasr/models/contextual_paraformer/model.py" | |
| - "funasr/models/seaco_paraformer/model.py" | |
| - "tests/test_timestamp_tools.py" | |
| - "tests/test_punc_model_none.py" | |
| - "tests/test_paraformer_hotword_file.py" | |
| - "tests/test_pcm_input_format.py" | |
| - "tests/test_load_audio_bytes.py" | |
| - "funasr/frontends/**" | |
| - "funasr/models/emotion2vec/**" | |
| - "funasr/models/campplus/**" | |
| - "funasr/models/sense_voice/model.py" | |
| - "funasr/models/eend/utils/feature.py" | |
| - "tests/test_numpy_compatibility.py" | |
| - "tests/test_numpy_cluster_compatibility.py" | |
| - "tests/test_eend_feature_compatibility.py" | |
| - "tests/test_sensevoice_word_timestamps.py" | |
| - "tests/test_pypi_metadata.py" | |
| - ".github/workflows/test-numpy-compatibility.yml" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "setup.py" | |
| - "funasr/__init__.py" | |
| - "funasr/cli.py" | |
| - "tests/test_cli.py" | |
| - "funasr/auto/auto_model.py" | |
| - "funasr/utils/load_utils.py" | |
| - "funasr/utils/timestamp_tools.py" | |
| - "funasr/models/contextual_paraformer/model.py" | |
| - "funasr/models/seaco_paraformer/model.py" | |
| - "tests/test_timestamp_tools.py" | |
| - "tests/test_punc_model_none.py" | |
| - "tests/test_paraformer_hotword_file.py" | |
| - "tests/test_pcm_input_format.py" | |
| - "tests/test_load_audio_bytes.py" | |
| - "funasr/frontends/**" | |
| - "funasr/models/emotion2vec/**" | |
| - "funasr/models/campplus/**" | |
| - "funasr/models/sense_voice/model.py" | |
| - "funasr/models/eend/utils/feature.py" | |
| - "tests/test_numpy_compatibility.py" | |
| - "tests/test_numpy_cluster_compatibility.py" | |
| - "tests/test_eend_feature_compatibility.py" | |
| - "tests/test_sensevoice_word_timestamps.py" | |
| - "tests/test_pypi_metadata.py" | |
| - ".github/workflows/test-numpy-compatibility.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| numpy-compatibility: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| numpy: ["1.26.4", "2.4.0"] | |
| env: | |
| OMP_NUM_THREADS: "1" | |
| MKL_NUM_THREADS: "1" | |
| NUMBA_NUM_THREADS: "1" | |
| HF_HUB_OFFLINE: "1" | |
| NUMPY_VERSION: ${{ matrix.numpy }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install audio decoder | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --no-install-recommends -y ffmpeg | |
| ffmpeg -version | |
| - name: Install CPU runtime and requested NumPy version | |
| run: | | |
| python -m pip install torch==2.10.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/cpu | |
| python -m pip install "numpy==$NUMPY_VERSION" -e . pytest einops pytorch-wpe --report install-report.json | |
| - name: Record resolved environment and validate dependencies | |
| run: | | |
| git rev-parse HEAD | tee source-commit.txt | |
| python -c "import numpy, os; assert numpy.__version__ == os.environ['NUMPY_VERSION']" | |
| python -m pip freeze | tee resolved-dependencies.txt | |
| python -m pip check | tee pip-check.txt | |
| - name: Exercise real frontend, masking, import, array and CLI boundaries | |
| run: | | |
| python -m pytest -q \ | |
| tests/test_numpy_compatibility.py \ | |
| tests/test_numpy_cluster_compatibility.py \ | |
| tests/test_eend_feature_compatibility.py \ | |
| tests/test_pypi_metadata.py \ | |
| tests/test_sensevoice_word_timestamps.py \ | |
| tests/test_pcm_input_format.py \ | |
| tests/test_load_audio_bytes.py \ | |
| tests/test_timestamp_tools.py \ | |
| tests/test_punc_model_none.py \ | |
| tests/test_paraformer_hotword_file.py \ | |
| tests/test_cli.py \ | |
| --junitxml=numpy-results.xml | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: numpy-${{ matrix.numpy }}-evidence | |
| path: | | |
| resolved-dependencies.txt | |
| pip-check.txt | |
| numpy-results.xml | |
| source-commit.txt | |
| install-report.json |