test.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: test
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. jobs:
  10. pre-commit:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Fetch base branch
  15. run: git fetch origin ${{ github.base_ref }}
  16. - uses: actions/setup-python@v4
  17. with:
  18. python-version: "3.8"
  19. architecture: x64
  20. - name: Get pip cache dir
  21. id: pip-cache
  22. run: |
  23. echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
  24. - name: pip/pre-commit cache
  25. uses: actions/cache@v3
  26. with:
  27. path: |
  28. ${{ steps.pip-cache.outputs.dir }}
  29. ~/.cache/pre-commit
  30. key: ${{ runner.os }}-pip-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
  31. restore-keys: |
  32. ${{ runner.os }}-pip-pre-commit
  33. - name: pre-commit
  34. run: |
  35. pip install -U pre-commit
  36. pre-commit install --install-hooks
  37. pre-commit run --all-files
  38. whisper-test:
  39. needs: pre-commit
  40. runs-on: ubuntu-latest
  41. strategy:
  42. matrix:
  43. python-version: ['3.8', '3.9', '3.10', '3.11']
  44. pytorch-version: [1.13.1, 2.0.0]
  45. exclude:
  46. - python-version: '3.11'
  47. pytorch-version: 1.13.1
  48. steps:
  49. - uses: conda-incubator/setup-miniconda@v2
  50. - run: conda install -n test ffmpeg python=${{ matrix.python-version }}
  51. - run: pip3 install torch==${{ matrix.pytorch-version }}+cpu --index-url https://download.pytorch.org/whl/cpu
  52. - uses: actions/checkout@v3
  53. - run: echo "$CONDA/envs/test/bin" >> $GITHUB_PATH
  54. - run: pip install .["dev"]
  55. - run: pytest --durations=0 -vv -k 'not test_transcribe or test_transcribe[tiny] or test_transcribe[tiny.en]' -m 'not requires_cuda'