mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
171 lines
5.1 KiB
YAML
171 lines
5.1 KiB
YAML
name: Build Audio Library (Windows)
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup vcpkg
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Cache vcpkg packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ env.VCPKG_INSTALLATION_ROOT }}\installed
|
|
${{ env.VCPKG_INSTALLATION_ROOT }}\packages
|
|
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}
|
|
restore-keys: |
|
|
vcpkg-${{ runner.os }}-
|
|
|
|
- name: Install vcpkg dependencies
|
|
run: |
|
|
vcpkg install portaudio:x64-windows
|
|
vcpkg install libsndfile:x64-windows
|
|
vcpkg install libsamplerate:x64-windows
|
|
vcpkg integrate install
|
|
|
|
- name: Setup MSVC environment
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Setup Developer Command Prompt
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: x64
|
|
|
|
- name: Debug Makefile and environment
|
|
run: |
|
|
echo "Current directory:"
|
|
dir
|
|
echo "Makefile exists:"
|
|
if exist Makefile (echo Yes) else (echo No)
|
|
echo "Available make targets:"
|
|
make help || echo "Help target not available"
|
|
echo "VCPKG_ROOT: %VCPKG_ROOT%"
|
|
echo "VCPKG_INSTALLATION_ROOT: %VCPKG_INSTALLATION_ROOT%"
|
|
echo "System detection:"
|
|
echo %OS%
|
|
echo "Compiler detection:"
|
|
where cl || echo "cl not found in PATH"
|
|
where gcc || echo "gcc not found in PATH"
|
|
echo "Testing Windows detection in Makefile:"
|
|
make -n all | head -5 || echo "Make dry-run failed"
|
|
shell: cmd
|
|
working-directory: libs/audio
|
|
env:
|
|
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
|
OS: Windows_NT
|
|
|
|
- name: Check dependencies
|
|
run: |
|
|
echo "Attempting to check dependencies..."
|
|
make check-deps || echo "check-deps target failed or not available, continuing..."
|
|
shell: cmd
|
|
working-directory: libs/audio
|
|
continue-on-error: true
|
|
env:
|
|
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
|
OS: Windows_NT
|
|
|
|
- name: Build audio library (Force Windows detection)
|
|
run: |
|
|
echo "Forcing Windows build..."
|
|
set "UNAME_S=Windows"
|
|
make all
|
|
shell: cmd
|
|
working-directory: libs/audio
|
|
env:
|
|
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
|
OS: Windows_NT
|
|
UNAME_S: Windows
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: libaudio-windows-x64
|
|
path: |
|
|
libs/audio/libaudio.dll
|
|
libs/audio/*.lib
|
|
retention-days: 30
|
|
|
|
- name: Run tests (if available)
|
|
run: |
|
|
if exist tests.exe (
|
|
echo Running tests...
|
|
tests.exe
|
|
) else (
|
|
echo No tests found, skipping...
|
|
)
|
|
shell: cmd
|
|
working-directory: libs/audio
|
|
continue-on-error: true
|
|
|
|
build-matrix:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
architecture: [x64, x86]
|
|
configuration: [Release, Debug]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup vcpkg
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Cache vcpkg packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ env.VCPKG_INSTALLATION_ROOT }}\installed
|
|
${{ env.VCPKG_INSTALLATION_ROOT }}\packages
|
|
key: vcpkg-${{ matrix.architecture }}-${{ matrix.configuration }}-${{ hashFiles('**/vcpkg.json') }}
|
|
restore-keys: |
|
|
vcpkg-${{ matrix.architecture }}-${{ matrix.configuration }}-
|
|
|
|
- name: Setup MSVC environment and Developer Command Prompt
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: ${{ matrix.architecture }}
|
|
|
|
- name: Install vcpkg dependencies
|
|
run: |
|
|
vcpkg install portaudio:${{ matrix.architecture }}-windows
|
|
vcpkg install libsndfile:${{ matrix.architecture }}-windows
|
|
vcpkg install libsamplerate:${{ matrix.architecture }}-windows
|
|
vcpkg integrate install
|
|
|
|
- name: Build library (${{ matrix.architecture }}, ${{ matrix.configuration }})
|
|
run: |
|
|
if ("${{ matrix.configuration }}" -eq "Debug") {
|
|
make debug
|
|
} else {
|
|
make all
|
|
}
|
|
shell: powershell
|
|
working-directory: libs/audio
|
|
env:
|
|
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
|
OS: Windows_NT
|
|
|
|
- name: Upload artifacts (${{ matrix.architecture }}, ${{ matrix.configuration }})
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: libaudio-windows-${{ matrix.architecture }}-${{ matrix.configuration }}
|
|
path: |
|
|
libs/audio/libaudio.dll
|
|
libs/audio/*.lib
|
|
libs/audio/*.pdb
|
|
retention-days: 30
|