From 109719b7f5f77048f64547825c46302eedaf644f Mon Sep 17 00:00:00 2001 From: Yonokid <37304577+Yonokid@users.noreply.github.com> Date: Sat, 27 Dec 2025 18:34:34 -0500 Subject: [PATCH] Update tests.yml --- .github/workflows/tests.yml | 227 +++++++++++++++++------------------- 1 file changed, 104 insertions(+), 123 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ffc704a..32deb26 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,146 +1,127 @@ name: Tests on: - push: - branches: [ main, master, develop ] - pull_request: - branches: [ main, master, develop ] - workflow_dispatch: + push: + branches: [main, master, develop] + pull_request: + branches: [main, master, develop] + workflow_dispatch: permissions: - contents: read + contents: read jobs: - test: - strategy: - fail-fast: false - matrix: - os: [ubuntu-22.04, windows-latest, macos-latest] - python-version: ['3.12'] + test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, windows-latest, macos-latest] + python-version: ["3.12"] - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os }} - steps: - - name: Check-out repository - uses: actions/checkout@v4 - with: - submodules: recursive + 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 (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 (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: 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 (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: 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 (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 (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: 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: Install uv + uses: astral-sh/setup-uv@v4 - - name: Setup Python ${{ matrix.python-version }} - run: uv python install ${{ matrix.python-version }} + - name: Setup Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - - name: Install dependencies - run: uv sync + - name: Install dependencies + run: uv sync - - name: Run tests - run: uv run pytest test/libs/ -v --tb=short --color=yes - continue-on-error: false + - name: Run tests + run: uv run pytest -v --tb=short --color=yes + continue-on-error: false - - name: Run tests with coverage - if: matrix.os == 'ubuntu-22.04' - run: | - uv run pytest test/libs/ --cov=libs --cov-report=xml --cov-report=html --cov-report=term + - 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 - - name: Upload coverage reports - if: matrix.os == 'ubuntu-22.04' - uses: codecov/codecov-action@v4 - with: - file: ./coverage.xml - flags: unittests - name: codecov-umbrella - fail_ci_if_error: false - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - continue-on-error: true - - - 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 + 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