Refactored audio players to remove duplicate functionality; fixed var… #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
qt-version: ["6.5.2"] | |
compiler: ["msvc2019_64"] | |
steps: | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt-version }} | |
host: "windows" | |
arch: "win64_${{ matrix.compiler }}" | |
tools: "tools_opensslv3_x64" | |
cache: "true" | |
modules: "qtimageformats qtmultimedia qtpdf qt5compat" | |
- name: Install Dependencies with Chocolatey | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: "install nasm curl" | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Setup Sentry CLI | |
uses: mathieu-bour/setup-sentry-cli@1.3.0 | |
with: | |
token: ${{ SECRETS.SENTRY_TOKEN }} | |
organization: rophil | |
project: gm-companion | |
- name: Install cget | |
run: pip install cget | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Setup build directory | |
run: mkdir build | |
- name: Cache cget dependencies | |
id: cache-cget | |
uses: actions/cache@v3 | |
with: | |
path: build/cget | |
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('requirements.windows.txt') }}-cget-${{ matrix.qt-version }}-${{ matrix.compiler }} | |
- name: Init cget | |
run: cd build && cget init --shared | |
- name: Install dependencies from requirements.txt | |
if: steps.cache-cget.outputs.cache-hit != 'true' | |
run: | | |
cd build | |
cget install --release -f ../requirements.windows.txt -DCMAKE_BUILD_PARALLEL_LEVEL=2 -DBUILD_TESTING=OFF | |
- name: Make | |
run: | | |
cd build | |
cmake .. -D CMAKE_INSTALL_PREFIX=install -D CMAKE_BUILD_TYPE=RelWithDebInfo -DIS_RUNNING_IN_CI=ON -DCMAKE_UNITY_BUILD=ON | |
cmake --build . --config RelWithDebInfo --parallel 2 | |
- name: Tests | |
run: | | |
cd build | |
cp ..\..\Qt\Tools\OpenSSLv3\Win_x64\bin\*.dll .\bin\RelWithDebInfo\ | |
cp .\cget\**\*.dll .\bin\RelWithDebInfo\ | |
ls bin | |
ls bin\RelWithDebInfo | |
ctest -C RelWithDebInfo --verbose | |
- name: Upload debug symbols | |
run: | | |
cd build | |
sentry-cli upload-dif --org rophil --project gm-companion --include-sources app/ | |
- name: Make Install | |
run: | | |
cd build | |
cmake --install . --config RelWithDebInfo | |
- name: Install CQtDeployer | |
run: | | |
curl -L -o .\cqtdeployer-installer.exe https://github.com/QuasarApp/CQtDeployer/releases/download/v1.6.2311/CQtDeployer_1.6.2311.76d1d20_Windows_AMD64.exe | |
.\cqtdeployer-installer.exe install -c --al -t ${{ github.workspace }}\cqtdeployer | |
- name: Download librespot | |
run: curl -L -o .\build\install\bin\librespot.exe https://github.com/PhilInTheGaps/librespot-bin/releases/download/v0.4.2/librespot-x86_64.exe | |
- name: Copy OpenSSL DLLs to install folder | |
run: cp ..\Qt\Tools\OpenSSLv3\Win_x64\bin\*.dll .\build\install\bin | |
- name: Deploy | |
run: ${{ github.workspace }}\cqtdeployer\1.6\CQtDeployer.exe -bin build\install\bin\gm-companion.exe,build\install\bin\librespot.exe -libDir build\cget\bin,build\cget\lib -qmlDir app\ui -targetDir build\install\bin | |
- name: Remove debug info from install folder | |
run: rm .\build\install\**\*.pdb | |
- name: Upload Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gm-companion_${{ runner.os }} | |
path: .\build\install\bin | |
if-no-files-found: error | |
# - name: Setup tmate session | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 | |
# timeout-minutes: 20 | |
# with: | |
# limit-access-to-actor: true | |
ubuntu: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
qt-version: ["6.5.2"] | |
compiler: ["gcc_64"] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- uses: kenchan0130/actions-system-info@master | |
id: system-info | |
- name: Install Dependencies | |
run: | | |
sudo add-apt-repository universe | |
sudo apt-get update -q | |
sudo apt-get upgrade -q | |
sudo apt install -qq mesa-common-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libjpeg-turbo8-dev libtiff-dev libnss3-dev libopenjp2-7-dev libboost-dev libcairo2-dev libcurl4-openssl-dev python3-setuptools patchelf libasound2-dev libsecret-1-dev libxcb-cursor0 libfuse2 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt-version }} | |
host: "linux" | |
arch: "${{ matrix.compiler }}" | |
target: "desktop" | |
cache: "true" | |
modules: "qtimageformats qtmultimedia qtpdf qt5compat" | |
- name: Setup Sentry CLI | |
uses: mathieu-bour/setup-sentry-cli@1.3.0 | |
with: | |
token: ${{ SECRETS.SENTRY_TOKEN }} | |
organization: rophil | |
project: gm-companion | |
- name: Install cget | |
run: sudo pip3 install wheel cget | |
- name: Setup build directory | |
run: mkdir build | |
- name: Cache cget dependencies | |
id: cache-cget | |
uses: actions/cache@v3 | |
with: | |
path: build/cget | |
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ runner.arch }}-${{ hashFiles('requirements.ubuntu.txt') }}-cget-${{ matrix.qt-version }} | |
- name: Build cget dependencies | |
if: steps.cache-cget.outputs.cache-hit != 'true' | |
run: | | |
cd build | |
cget init --shared | |
cget install --release -f ../requirements.ubuntu.txt -DCMAKE_BUILD_PARALLEL_LEVEL=2 -DBUILD_TESTING=OFF | |
- name: CMake | |
run: | | |
cd build | |
cmake .. -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_INSTALL_PREFIX=AppDir/usr -DIS_RUNNING_IN_CI=ON -DCMAKE_UNITY_BUILD=ON | |
- name: Linter (QML) | |
run: | | |
cd build | |
cmake --build . --target=all_qmllint -j2 | |
- name: Make | |
run: | | |
export QT_QPA_PLATFORM="offscreen" | |
cd build | |
cmake --build . -j2 | |
- name: Tests | |
run: | | |
export QT_QPA_PLATFORM="offscreen" | |
cd build | |
ctest --output-on-failure | |
- name: Make Install | |
run: | | |
cd build | |
cmake --install . | |
- name: Strip and upload debug symbols | |
run: | | |
cd build | |
../deploy/debug/generate-debug-info.sh AppDir/usr/bin/gm-companion | |
sentry-cli upload-dif --org rophil --project gm-companion --include-sources AppDir/usr/bin/.debug/ | |
rm -rf AppDir/usr/bin/.debug | |
- name: Install rust and build librespot | |
uses: moonrepo/setup-rust@v1 | |
with: | |
bins: librespot | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build AppImage | |
run: | | |
cd build | |
cp ~/.cargo/bin/librespot AppDir/usr/bin/librespot | |
bash ../deploy/appimage/build-appimage.sh | |
ls | |
- name: Upload Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gm-companion_x86_64.AppImage | |
path: build/GM-Companion-x86_64.AppImage | |
if-no-files-found: error | |
static-analysis: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
qt-version: ["6.5.2"] | |
compiler: ["gcc_64"] | |
env: | |
SONAR_SCANNER_VERSION: 4.8.0.2856 | |
SONAR_SERVER_URL: "https://sonarcloud.io" | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
fetch-depth: 0 | |
- uses: kenchan0130/actions-system-info@master | |
id: system-info | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -q | |
sudo apt-get upgrade -q | |
sudo apt install -qq mesa-common-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libjpeg-turbo8-dev libtiff-dev libnss3-dev libopenjp2-7-dev libboost-dev libcairo2-dev libcurl4-openssl-dev python3-setuptools patchelf libasound2-dev libsecret-1-dev libxcb-cursor0 | |
sudo pip3 install gcovr | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt-version }} | |
host: "linux" | |
arch: "${{ matrix.compiler }}" | |
target: "desktop" | |
cache: "true" | |
modules: "qtimageformats qtmultimedia qtpdf qt5compat" | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Download and set up sonar-scanner | |
env: | |
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip | |
run: | | |
mkdir -p $HOME/.sonar | |
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} | |
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ | |
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH | |
- name: Download and set up build-wrapper | |
env: | |
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip | |
run: | | |
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }} | |
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ | |
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH | |
- name: Install cget | |
run: sudo pip3 install wheel cget | |
- name: Setup build directory | |
run: mkdir build | |
- name: Cache cget dependencies | |
id: cache-cget | |
uses: actions/cache@v3 | |
with: | |
path: build/cget | |
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ runner.arch }}-${{ hashFiles('requirements.ubuntu.txt') }}-cget-${{ matrix.qt-version }} | |
- name: Build cget dependencies | |
if: steps.cache-cget.outputs.cache-hit != 'true' | |
run: | | |
cd build | |
cget init --shared | |
cget install --release -f ../requirements.ubuntu.txt -DCMAKE_BUILD_PARALLEL_LEVEL=2 -DBUILD_TESTING=OFF | |
- name: Run build-wrapper | |
run: | | |
export QT_QPA_PLATFORM="offscreen" | |
cd build | |
cmake .. -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=AppDir/usr -DIS_RUNNING_IN_CI=ON -DENABLE_CODE_COVERAGE=ON | |
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build . -j2 | |
- name: Tests | |
run: | | |
export QT_QPA_PLATFORM="offscreen" | |
cd build | |
ctest --output-on-failure | |
- name: Generate GCOV Report | |
run: | | |
cd build | |
gcovr --keep --print-summary | |
- name: Cache sonar analysis | |
id: cache-sonar-analysis | |
uses: actions/cache@v3 | |
with: | |
path: sonar-cache | |
key: ${{ runner.os }}-SonarAnalysis | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: sonar-scanner |