Pin onnxruntime versions, update deps #449
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| permissions: | |
| contents: read | |
| env: | |
| HF_HOME: ${{ github.workspace }}/.cache/huggingface | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv sync --locked --extra cpu | |
| - name: Check code formatting with Ruff | |
| run: uv run --extra cpu ruff format --diff | |
| - name: Check code with Ruff | |
| run: uv run --extra cpu ruff check --output-format=github | |
| - name: Check types with MyPy | |
| run: uv run --extra cpu mypy . | |
| - name: Check Jupyter outputs | |
| run: find . -name '*.ipynb' -exec uv run nbstripout --verify {} + | |
| build: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| - name: Install dependencies | |
| run: uv sync --extra cpu --group test-all --group docs | |
| - name: Cache HF models | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.HF_HOME }} | |
| key: ${{ runner.os }}-hf-models | |
| - name: Test with pytest | |
| run: pytest --cov --cov-report term --cov-report xml --junitxml junit.xml -o junit_family=legacy | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v6 | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| report_type: test_results | |
| - name: Build docs site | |
| run: mkdocs build --strict | |
| - name: Build package dist | |
| run: | | |
| uv pip compile --group build --generate-hashes -o build-constraints.txt | |
| uv build -b build-constraints.txt --require-hashes | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels | |
| path: ./dist/onnx_asr-*.whl | |
| retention-days: 3 | |
| test: | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| os: | |
| [ | |
| ubuntu-latest, | |
| windows-latest, | |
| macos-latest, | |
| ubuntu-24.04-arm, | |
| windows-11-arm, | |
| macos-15-intel, | |
| ] | |
| include: | |
| - soundfile: soundfile | |
| - python-version: "3.10" | |
| numpy: numpy==1.22.4 | |
| onnxruntime: onnxruntime==1.20.1 | |
| hf-hub: huggingface-hub==0.30.2 | |
| typing: typing-extensions==4.6.0 | |
| - python-version: "3.11" | |
| numpy: numpy~=1.26 | |
| onnxruntime: onnxruntime~=1.22.1 | |
| hf-hub: huggingface-hub~=0.36 | |
| - python-version: "3.12" | |
| numpy: numpy~=2.0.2 | |
| onnxruntime: onnxruntime~=1.23.2 | |
| hf-hub: huggingface-hub~=1.0.1 | |
| - python-version: "3.13" | |
| numpy: numpy~=2.3.5 | |
| onnxruntime: onnxruntime~=1.24.4 | |
| - python-version: "3.13t" | |
| os: ubuntu-latest | |
| soundfile: "" | |
| - python-version: "3.13t" | |
| os: ubuntu-24.04-arm | |
| soundfile: "" | |
| - python-version: "3.14t" | |
| os: ubuntu-latest | |
| soundfile: soundfile | |
| - python-version: "3.14t" | |
| os: ubuntu-24.04-arm | |
| soundfile: soundfile | |
| - os: windows-11-arm | |
| numpy: numpy~=2.3.5 | |
| onnxruntime: onnxruntime~=1.24.4 | |
| - os: windows-11-arm | |
| python-version: "3.14" | |
| numpy: "" | |
| onnxruntime: "" | |
| exclude: | |
| - os: windows-11-arm | |
| python-version: "3.10" | |
| - os: macos-15-intel | |
| python-version: "3.14" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv with Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: wheels | |
| path: ./dist | |
| - name: Install packages | |
| shell: bash | |
| run: >- | |
| uv pip install --group test $(find ./dist -name onnx_asr-*.whl)[cpu,hub] | |
| ${{ matrix.numpy }} | |
| ${{ matrix.onnxruntime }} | |
| ${{ matrix.hf-hub }} | |
| ${{ matrix.typing }} | |
| ${{ matrix.soundfile }} | |
| - name: Cache HF models | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.HF_HOME }} | |
| key: ${{ runner.os }}-hf-models | |
| - name: Test with pytest | |
| run: pytest ./tests/onnx_asr --junitxml junit.xml -o junit_family=legacy | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| report_type: test_results | |
| flags: ${{ matrix.os }},python-${{ matrix.python-version }} | |
| - name: Build dist | |
| if: ${{ matrix.python-version != '3.13t' && matrix.python-version != '3.14t' }} | |
| run: uv build | |
| complete: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 |