|
@@ -6,8 +6,38 @@ on:
|
|
|
pull_request:
|
|
|
branches:
|
|
|
- main
|
|
|
+
|
|
|
jobs:
|
|
|
+ pre-commit:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - name: Fetch base branch
|
|
|
+ run: git fetch origin ${{ github.base_ref }}
|
|
|
+ - uses: actions/setup-python@v4
|
|
|
+ with:
|
|
|
+ python-version: "3.8"
|
|
|
+ architecture: x64
|
|
|
+ - name: Get pip cache dir
|
|
|
+ id: pip-cache
|
|
|
+ run: |
|
|
|
+ echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
|
|
+ - name: pip/pre-commit cache
|
|
|
+ uses: actions/cache@v3
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ ${{ steps.pip-cache.outputs.dir }}
|
|
|
+ ~/.cache/pre-commit
|
|
|
+ key: ${{ runner.os }}-pip-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
|
|
|
+ restore-keys: |
|
|
|
+ ${{ runner.os }}-pip-pre-commit
|
|
|
+ - name: pre-commit
|
|
|
+ run: |
|
|
|
+ pip install -U pre-commit
|
|
|
+ pre-commit install --install-hooks
|
|
|
+ pre-commit run --from-ref=origin/${{ github.base_ref }} --to-ref=HEAD
|
|
|
whisper-test:
|
|
|
+ needs: pre-commit
|
|
|
runs-on: ubuntu-latest
|
|
|
strategy:
|
|
|
matrix:
|
|
@@ -23,7 +53,4 @@ jobs:
|
|
|
- uses: actions/checkout@v3
|
|
|
- run: echo "$CONDA/envs/test/bin" >> $GITHUB_PATH
|
|
|
- run: pip install .["dev"]
|
|
|
- - run: black --check --diff -t py38 --include '(\.pyi?)$' .
|
|
|
- - run: isort --check --diff .
|
|
|
- - run: flake8 --ignore E203,W503,W504,E501,E731,E741 .
|
|
|
- run: pytest --durations=0 -vv -k 'not test_transcribe or test_transcribe[tiny] or test_transcribe[tiny.en]' -m 'not requires_cuda'
|