Skip to content

Reorganizing tests

Reorganizing tests #1

name: github-runner-tests
on:
pull_request:
jobs:
macos-tests:
name: macOS-tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- {os: macos-latest, architecture: arm64, python-version: '3.10'}
- {os: macos-latest, architecture: arm64, python-version: '3.11'}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1 # no need for the history
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install ffmpeg (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y ffmpeg
shell: bash
- name: Install ffmpeg (macOS)
if: startsWith(matrix.os, 'macos')
run: brew install ffmpeg
shell: bash
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies with Poetry
run: |
poetry run pip install iso-639
poetry install --with dev
shell: bash
- name: Run unit tests
id: run-tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: >
poetry run pytest -n auto \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov-report=xml:coverage.xml \
--cov=src src/tests \
--log-level=DEBUG \
--verbose
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
pre-commit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
with: # no need for the history
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies with Poetry
run: |
poetry run pip install iso-639
poetry install --with dev
shell: bash
- name: Install pre-commit
run: pipx install pre-commit
shell: bash
- name: Run pre-commit
run: |
poetry run pre-commit run --all-files
shell: bash