-
Notifications
You must be signed in to change notification settings - Fork 33
74 lines (60 loc) · 2.41 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# 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: [ "master", "dev" ]
pull_request:
branches: [ "master" ]
jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
os: [ windows-latest, ubuntu-latest ]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pypoetry
~/.venv
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
${{ runner.os }}-poetry-
${{ runner.os }}-
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
poetry lock --no-update
poetry install
poetry run pip uninstall -y faster-whisper
poetry run pip install "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/d57c5b40b06e59ec44240d93485a95799548af50.tar.gz"
poetry run pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
- name: Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
id: setup-ffmpeg
- name: Add OpenAI key to environment variables
run: echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
- name: Add ANTHROPIC API Key to environment variables
run: echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> $GITHUB_ENV
- name: Add Google API Key to environment variables
run: echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" >> $GITHUB_ENV
- name: Test with unittest
working-directory: ./tests
run: |
poetry run python -m unittest discover -s . -p 'test_*.py'