Skip to content

fix bug in AudioResampler #159

fix bug in AudioResampler

fix bug in AudioResampler #159

name: Run Unit Tests
on: [pull_request, push]
jobs:
Build:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-13
qt-version: ['5.15.2', '6.5.3']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Initialize Building Environment
uses: ./.github/actions/init-build
with:
os: ${{ matrix.os }}
qt-version: ${{ matrix.qt-version }}
- name: Build TALCS
shell: pwsh
run: |
cmake -B build -G Ninja `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT_DIR }}/scripts/buildsystems/vcpkg.cmake" `
-DTALCS_BUILD_TESTS:BOOL=ON `
-DTALCS_ENABLE_ASIO:BOOL=ON `
-DTALCS_REMOTE:BOOL=ON `
-DTALCS_DSPX:BOOL=ON `
-DTALCS_GUI:BOOL=ON `
-DTALCS_ASIOSDK_DIR=${{ env.ASIOSDK_DIR }}
cmake --build build
$binaryDir = (Get-ChildItem -Path build -Filter out-* -Directory)[0]
Write-Output BUILD_BINARY_DIR=$(Resolve-Path -Path $binaryDir) >> $env:GITHUB_ENV
- name: Upload TALCS binary artifact
uses: actions/upload-artifact@v3
with:
name: TALCS_${{ runner.os }}_Qt${{ matrix.qt-version }}_${{ github.sha }}
path: ${{ env.BUILD_BINARY_DIR }}
- name: Run TALCS unit tests
shell: pwsh
run: |
$binaryDir = (Get-ChildItem -Path build -Filter out-* -Directory)[0]
$unitTestPrograms = (Get-ChildItem -Path $binaryDir/bin -Filter talcs_UnitTest_*${{ matrix.os == 'windows-latest' && '.exe' || '' }})
$flag = 0
foreach ($program in $unitTestPrograms) {
Write-Output "Unit test: $($program.Name)"
& $program
if ($LASTEXITCODE -ne 0) {
Write-Output "Unit test failed: $($program.Name)"
$flag++
}
}
if ($flag) {
Write-Output "$flag unit test(s) failed."
exit 1
} else {
Write-Output "All unit tests passed."
exit 0
}