Added github workflow that automatically creates a release when a tag… #153
Workflow file for this run
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.3"] | |
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/[email protected] | |
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 ./ | |
- 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.2323/CQtDeployer_1.6.2323.dd027b2_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 -enablePlugins multimedia | |
- name: Remove debug and test info from install folder | |
run: | | |
rm .\build\install\gmock* | |
rm .\build\install\gtest* | |
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.3"] | |
compiler: ["gcc_64"] | |
env: | |
QT_QPA_PLATFORM: "offscreen" | |
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 gnome-keyring dbus-x11 libxcb-cursor0 libfuse2 | |
- name: Unlock Keyring | |
uses: t1m0thyj/unlock-keyring@v1 | |
- 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/[email protected] | |
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: | | |
cd build | |
cmake --build . -j2 | |
- name: Tests | |
run: | | |
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.3"] | |
compiler: ["gcc_64"] | |
env: | |
QT_QPA_PLATFORM: "offscreen" | |
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 gnome-keyring dbus-x11 libxcb-cursor0 | |
sudo pip3 install gcovr | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Unlock Keyring | |
uses: t1m0thyj/unlock-keyring@v1 | |
- 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: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarcloud-github-c-cpp@v1 | |
- 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: | | |
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: | | |
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 |