mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-22 18:14:38 +01:00
123 lines
3.1 KiB
YAML
123 lines
3.1 KiB
YAML
---
|
|
name: Test
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- '*'
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
windows-latest:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10.7'
|
|
|
|
- name: Install Poetry Action
|
|
uses: snok/install-poetry@v1.3.1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-Windows-${{ hashFiles('**/poetry.lock') }}-2
|
|
|
|
- name: Load cached Whisper models
|
|
id: cached-whisper-models
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cache/whisper
|
|
~/.cache/huggingface
|
|
~/AppData/Local/Buzz/Buzz/Cache
|
|
key: whisper-models-Windows
|
|
|
|
- uses: FedericoCarboni/setup-ffmpeg@v1
|
|
id: setup-ffmpeg
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install dependencies
|
|
run: poetry config experimental.new-installer false && poetry install
|
|
|
|
- name: Test
|
|
run: poetry run make test
|
|
|
|
- name: Upload coverage reports to Codecov with GitHub Action
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
flags: Windows
|
|
|
|
macos-latest:
|
|
runs-on: macos-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
cpu: [ intel, arm ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10.7'
|
|
|
|
- name: Install Poetry Action
|
|
uses: snok/install-poetry@v1.3.1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-macOS-${{ hashFiles('**/poetry.lock') }}-2
|
|
|
|
- name: Load cached Whisper models
|
|
id: cached-whisper-models
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/Library/Caches/Buzz
|
|
~/.cache/whisper
|
|
~/.cache/huggingface
|
|
key: whisper-models-macOS
|
|
|
|
- uses: FedericoCarboni/setup-ffmpeg@v1
|
|
id: setup-ffmpeg
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install dependencies
|
|
run: poetry config experimental.new-installer false && poetry install
|
|
|
|
- name: Test
|
|
run: |
|
|
if [[ ${{ matrix.cpu }} == "intel" ]]; then
|
|
poetry run make test;
|
|
else
|
|
poetry run make whisper_cpp CMAKE_FLAGS="-DWHISPER_NO_AVX=ON -DWHISPER_NO_AVX2=ON -DWHISPER_NO_FMA=ON";
|
|
fi
|
|
|
|
- name: Upload coverage reports to Codecov with GitHub Action
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
flags: macOS-${{ matrix.cpu }}
|