Files
PyTaiko/.github/workflows/tests.yml
2025-12-27 18:34:34 -05:00

128 lines
3.9 KiB
YAML

name: Tests
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Install libaudio Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install portaudio libsndfile speexdsp ccache
- name: Install libaudio Dependencies (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
mingw-w64-x86_64-gcc
mingw-w64-x86_64-libsndfile
mingw-w64-x86_64-speexdsp
mingw-w64-x86_64-ccache
- name: Install libaudio Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
libsndfile1-dev \
libspeexdsp-dev \
portaudio19-dev \
libpulse-dev \
ccache
- name: Build libaudio (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cd libs/audio
make clean
make all
make verify
- name: Build libaudio (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
cd libs/audio
make clean
make all
make verify
- name: Copy libaudio to project root (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
cp libs/audio/*.dll . 2>/dev/null || echo "libaudio not found"
- name: Copy libaudio to project root (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
cp libs/audio/libaudio.dylib . 2>/dev/null || echo "libaudio not found"
- name: Copy libaudio to project root (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
cp libs/audio/libaudio.so . 2>/dev/null || echo "libaudio not found"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Setup Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync
- name: Run tests
run: uv run pytest -v --tb=short --color=yes
continue-on-error: false
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
*.log
temp/
if-no-files-found: ignore
retention-days: 7
test-summary:
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- name: Test Summary
run: |
echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "All platform tests completed!" >> $GITHUB_STEP_SUMMARY