mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
rah
This commit is contained in:
193
.github/workflows/build_audio.yml
vendored
193
.github/workflows/build_audio.yml
vendored
@@ -1,148 +1,123 @@
|
||||
# GitHub Actions workflow for building audio library
|
||||
name: Build Audio Library
|
||||
name: Build Audio Library (Windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
paths:
|
||||
- "libs/audio/**"
|
||||
- ".github/workflows/build-audio.yml"
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
paths:
|
||||
- "libs/audio/**"
|
||||
- ".github/workflows/build-audio.yml"
|
||||
workflow_dispatch: # Allow manual triggering
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
name: Build on Linux
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
portaudio19-dev \
|
||||
libsndfile1-dev \
|
||||
libsamplerate0-dev \
|
||||
libasound2-dev
|
||||
|
||||
- name: Check dependencies
|
||||
run: make -C libs/audio check-deps
|
||||
|
||||
- name: Build library
|
||||
run: make -C libs/audio all
|
||||
|
||||
- name: Build debug version
|
||||
run: make -C libs/audio debug
|
||||
|
||||
- name: Test library exists
|
||||
run: |
|
||||
ls -la libs/audio/
|
||||
test -f libs/audio/libaudio.so
|
||||
|
||||
- name: Upload Linux artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: libaudio-linux
|
||||
path: libs/audio/libaudio.so
|
||||
retention-days: 30
|
||||
|
||||
build-windows:
|
||||
name: Build on Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup vcpkg
|
||||
uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
vcpkgGitCommitId: "a42af01b72c28a8e1d7b48107b33e4f286a55ef6"
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Install dependencies with vcpkg
|
||||
- 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 update
|
||||
vcpkg install portaudio:x64-windows
|
||||
vcpkg install libsndfile:x64-windows
|
||||
vcpkg install libsamplerate:x64-windows
|
||||
vcpkg integrate install
|
||||
|
||||
- name: Setup MSVC
|
||||
- name: Setup MSVC environment
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Setup Developer Command Prompt
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Set vcpkg environment variables
|
||||
shell: cmd
|
||||
run: |
|
||||
echo VCPKG_INSTALLATION_ROOT=%VCPKG_ROOT% >> %GITHUB_ENV%
|
||||
echo VCPKG_INCLUDE_PATH=%VCPKG_ROOT%\installed\x64-windows\include >> %GITHUB_ENV%
|
||||
echo VCPKG_LIB_PATH=%VCPKG_ROOT%\installed\x64-windows\lib >> %GITHUB_ENV%
|
||||
|
||||
- name: Check dependencies
|
||||
run: make check-deps
|
||||
shell: cmd
|
||||
run: make -C libs/audio check-deps
|
||||
env:
|
||||
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
||||
|
||||
- name: Build library
|
||||
- name: Build audio library
|
||||
run: make all
|
||||
shell: cmd
|
||||
run: make -C libs/audio all
|
||||
env:
|
||||
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
||||
|
||||
- name: Build debug version
|
||||
shell: cmd
|
||||
run: make -C libs/audio debug
|
||||
|
||||
- name: Test library exists
|
||||
shell: cmd
|
||||
run: |
|
||||
dir libs\audio\
|
||||
if not exist "libs\audio\libaudio.dll" exit /b 1
|
||||
|
||||
- name: Upload Windows artifact
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: libaudio-windows
|
||||
path: libs/audio/libaudio.dll
|
||||
name: libaudio-windows-x64
|
||||
path: |
|
||||
libaudio.dll
|
||||
*.lib
|
||||
retention-days: 30
|
||||
|
||||
build-summary:
|
||||
name: Build Summary
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-linux, build-windows]
|
||||
if: always()
|
||||
- name: Run tests (if available)
|
||||
run: |
|
||||
if exist tests.exe (
|
||||
echo Running tests...
|
||||
tests.exe
|
||||
) else (
|
||||
echo No tests found, skipping...
|
||||
)
|
||||
shell: cmd
|
||||
continue-on-error: true
|
||||
|
||||
build-matrix:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [x64, x86]
|
||||
configuration: [Release, Debug]
|
||||
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Display build results
|
||||
- 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: Install vcpkg dependencies
|
||||
run: |
|
||||
echo "## Build Results" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
vcpkg install portaudio:${{ matrix.architecture }}-windows
|
||||
vcpkg install libsndfile:${{ matrix.architecture }}-windows
|
||||
vcpkg install libsamplerate:${{ matrix.architecture }}-windows
|
||||
vcpkg integrate install
|
||||
|
||||
if [ -f libaudio-linux/libaudio.so ]; then
|
||||
echo "✅ Linux build: SUCCESS" >> $GITHUB_STEP_SUMMARY
|
||||
ls -lh libaudio-linux/libaudio.so >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "❌ Linux build: FAILED" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
- name: Build library (${{ matrix.architecture }}, ${{ matrix.configuration }})
|
||||
run: |
|
||||
if ("${{ matrix.configuration }}" -eq "Debug") {
|
||||
make debug
|
||||
} else {
|
||||
make all
|
||||
}
|
||||
shell: powershell
|
||||
env:
|
||||
VCPKG_INSTALLATION_ROOT: ${{ env.VCPKG_ROOT }}
|
||||
|
||||
if [ -f libaudio-windows/libaudio.dll ]; then
|
||||
echo "✅ Windows build: SUCCESS" >> $GITHUB_STEP_SUMMARY
|
||||
ls -lh libaudio-windows/libaudio.dll >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "❌ Windows build: FAILED" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Artifacts are available for download from the Actions page." >> $GITHUB_STEP_SUMMARY
|
||||
- name: Upload artifacts (${{ matrix.architecture }}, ${{ matrix.configuration }})
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: libaudio-windows-${{ matrix.architecture }}-${{ matrix.configuration }}
|
||||
path: |
|
||||
libaudio.dll
|
||||
*.lib
|
||||
*.pdb
|
||||
retention-days: 30
|
||||
|
||||
Reference in New Issue
Block a user