ci: Add install-dependencies action
This commit is contained in:
parent
a362174e73
commit
b2532c81b9
6 changed files with 134 additions and 67 deletions
100
.github/actions/install-dependencies/action.yml
vendored
Normal file
100
.github/actions/install-dependencies/action.yml
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
# SPDX-FileCopyrightText: 2024 Chris Rizzitello <sithlord48@gmail.com>
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
name: "Install dependencies for deskflow"
|
||||||
|
description: "Install the dependencies needed to build deskflow"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
like:
|
||||||
|
description: "Used only on linux distro type: debian, fedora, suse, arch"
|
||||||
|
required: false
|
||||||
|
|
||||||
|
mac-qt-version:
|
||||||
|
description: "The verison of Qt to install on mac os"
|
||||||
|
required: false
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
vcpkg-cmake-config:
|
||||||
|
description: "windows vcpkg output for cmaket"
|
||||||
|
value: ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install Depends
|
||||||
|
run: |
|
||||||
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
|
echo "Window not supported yet"
|
||||||
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||||
|
brew install cmake googletest ninja openssl --quiet
|
||||||
|
elif [ "$RUNNER_OS" == "Linux" ]; then
|
||||||
|
if [ ${{inputs.like}} == "debian" ]; then
|
||||||
|
apt update -qqq > /dev/null
|
||||||
|
apt install -qqq cmake build-essential ninja-build \
|
||||||
|
xorg-dev libx11-dev libxtst-dev libssl-dev \
|
||||||
|
libglib2.0-dev libgdk-pixbuf-2.0-dev libnotify-dev \
|
||||||
|
libxkbfile-dev qt6-base-dev qt6-tools-dev \
|
||||||
|
libgtk-3-dev libgtest-dev libgmock-dev libpugixml-dev \
|
||||||
|
libei-dev libportal-dev libtomlplusplus-dev libcli11-dev -y >/dev/null
|
||||||
|
elif [ ${{inputs.like}} == "fedora" ]; then
|
||||||
|
dnf install -y cmake make ninja-build gcc-c++ \
|
||||||
|
rpm-build openssl-devel glib2-devel \
|
||||||
|
gdk-pixbuf2-devel libXtst-devel libnotify-devel \
|
||||||
|
libxkbfile-devel qt6-qtbase-devel qt6-qttools-devel \
|
||||||
|
gtk3-devel gtest-devel gmock-devel pugixml-devel \
|
||||||
|
libei-devel libportal-devel tomlplusplus-devel \
|
||||||
|
cli11-devel
|
||||||
|
elif [ ${{inputs.like}} == "suse" ]; then
|
||||||
|
zypper refresh
|
||||||
|
zypper install -y --force-resolution \
|
||||||
|
cmake make ninja gcc-c++ rpm-build libopenssl-devel \
|
||||||
|
glib2-devel gdk-pixbuf-devel libXtst-devel libnotify-devel \
|
||||||
|
libxkbfile-devel qt6-base-devel qt6-tools-devel gtk3-devel \
|
||||||
|
googletest-devel googlemock-devel pugixml-devel libei-devel \
|
||||||
|
libportal-devel tomlplusplus-devel cli11-devel
|
||||||
|
elif [ ${{ inputs.like }} == "arch" ]; then
|
||||||
|
pacman -Syu --noconfirm base-devel cmake ninja \
|
||||||
|
gcc openssl glib2 gdk-pixbuf2 libxtst libnotify \
|
||||||
|
libxkbfile gtest pugixml libei libportal \
|
||||||
|
qt6-base qt6-tools gtk3 tomlplusplus cli11
|
||||||
|
else
|
||||||
|
echo "Unknown like"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Unknown OS: $RUNNER_OS"
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install Qt
|
||||||
|
if: ${{runner.os == 'macOS' }}
|
||||||
|
uses: jurplel/install-qt-action@v4
|
||||||
|
with:
|
||||||
|
dir: "/Users/runner"
|
||||||
|
version: ${{inputs.mac-qt-version}}
|
||||||
|
cache: true
|
||||||
|
cache-key-prefix: ${{matrix.target.os}}-${{env.qt-version}}
|
||||||
|
|
||||||
|
# Install Ninja with an action instead of using Chocolatey, as it's more
|
||||||
|
# reliable and faster. The Ninja install action is pretty good as it
|
||||||
|
# downloads directly from the `ninja-build` GitHub project releases.
|
||||||
|
- name: Install Ninja
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
uses: seanmiddleditch/gha-setup-ninja@master
|
||||||
|
|
||||||
|
- name: Build and cache vcpkg
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
id: vcpkg
|
||||||
|
uses: johnwason/vcpkg-action@v6
|
||||||
|
with:
|
||||||
|
manifest-dir: ${{ github.workspace }}
|
||||||
|
triplet: x64-windows-release
|
||||||
|
token: ${{ github.token }}
|
||||||
|
github-binarycache: true
|
||||||
|
|
||||||
|
- name: Install Wix
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
run: |
|
||||||
|
dotnet tool install --global wix --version 4.0.4
|
||||||
|
wix extension add --global WixToolset.UI.wixext/4.0.4
|
||||||
|
shell: pwsh
|
||||||
10
.github/workflows/ci-linux.json
vendored
10
.github/workflows/ci-linux.json
vendored
|
|
@ -4,21 +4,25 @@
|
||||||
"name": "debian-13-amd64",
|
"name": "debian-13-amd64",
|
||||||
"container": "deskflow/deskflow:debian-13-amd64",
|
"container": "deskflow/deskflow:debian-13-amd64",
|
||||||
"runs-on": "ubuntu-latest",
|
"runs-on": "ubuntu-latest",
|
||||||
|
"like": "debian"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fedora-40-arm64",
|
"name": "fedora-40-arm64",
|
||||||
"container": "deskflow/deskflow:fedora-40-arm64",
|
"container": "deskflow/deskflow:fedora-40-arm64",
|
||||||
"runs-on": "ubuntu-24.04-4-core-arm64"
|
"runs-on": "ubuntu-24.04-4-core-arm64",
|
||||||
|
"like": "fedora"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fedora-40-amd64",
|
"name": "fedora-40-amd64",
|
||||||
"container": "deskflow/deskflow:fedora-40-amd64",
|
"container": "deskflow/deskflow:fedora-40-amd64",
|
||||||
"runs-on": "ubuntu-latest"
|
"runs-on": "ubuntu-latest",
|
||||||
|
"like": "fedora"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "opensuse-amd64",
|
"name": "opensuse-amd64",
|
||||||
"container": "deskflow/deskflow:opensuse-amd64",
|
"container": "deskflow/deskflow:opensuse-amd64",
|
||||||
"runs-on": "ubuntu-latest"
|
"runs-on": "ubuntu-latest",
|
||||||
|
"like": "suse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "archlinux-amd64",
|
"name": "archlinux-amd64",
|
||||||
|
|
|
||||||
56
.github/workflows/ci.yml
vendored
56
.github/workflows/ci.yml
vendored
|
|
@ -134,20 +134,9 @@ jobs:
|
||||||
- name: Setup VC++ environment
|
- name: Setup VC++ environment
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
# Install Ninja with an action instead of using Chocolatey, as it's more
|
- name: Install dependencies
|
||||||
# reliable and faster. The Ninja install action is pretty good as it
|
id: install-dependencies
|
||||||
# downloads directly from the `ninja-build` GitHub project releases.
|
uses: ./.github/actions/install-dependencies
|
||||||
- name: Install Ninja
|
|
||||||
uses: seanmiddleditch/gha-setup-ninja@master
|
|
||||||
|
|
||||||
- name: Dependencies (vcpkg)
|
|
||||||
id: vcpkg
|
|
||||||
uses: johnwason/vcpkg-action@v6
|
|
||||||
with:
|
|
||||||
manifest-dir: ${{ github.workspace }}
|
|
||||||
triplet: x64-windows-release
|
|
||||||
token: ${{ github.token }}
|
|
||||||
github-binarycache: true
|
|
||||||
|
|
||||||
- name: Setup Python venv
|
- name: Setup Python venv
|
||||||
run: python ./scripts/setup_venv.py
|
run: python ./scripts/setup_venv.py
|
||||||
|
|
@ -155,7 +144,7 @@ jobs:
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
${{env.CMAKE_CONFIGURE}} -G Ninja `
|
${{env.CMAKE_CONFIGURE}} -G Ninja `
|
||||||
${{ steps.vcpkg.outputs.vcpkg-cmake-config }}
|
${{ steps.install-dependencies.outputs.vcpkg-cmake-config }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build -j8
|
run: cmake --build build -j8
|
||||||
|
|
@ -210,19 +199,10 @@ jobs:
|
||||||
- name: Fancy Checkout
|
- name: Fancy Checkout
|
||||||
uses: sithlord48/fancy-checkout@v1.0.0
|
uses: sithlord48/fancy-checkout@v1.0.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install Dependencies
|
||||||
run: brew install cmake ninja openssl googletest --quiet
|
uses: ./.github/actions/install-dependencies
|
||||||
|
|
||||||
- name: Install Qt
|
|
||||||
uses: jurplel/install-qt-action@v4
|
|
||||||
with:
|
with:
|
||||||
dir: ${{env.qt-install-dir}}
|
mac-qt-version: 6.7.2
|
||||||
version: ${{env.qt-version}}
|
|
||||||
cache: true
|
|
||||||
cache-key-prefix: ${{matrix.target.os}}-${{env.qt-version}}
|
|
||||||
env:
|
|
||||||
qt-version: 6.7.2
|
|
||||||
qt-install-dir: "/Users/runner"
|
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: ${{env.CMAKE_CONFIGURE}} ${{matrix.target.extra-cmake-config}}
|
run: ${{env.CMAKE_CONFIGURE}} ${{matrix.target.extra-cmake-config}}
|
||||||
|
|
@ -293,22 +273,10 @@ jobs:
|
||||||
- name: Fancy Checkout
|
- name: Fancy Checkout
|
||||||
uses: sithlord48/fancy-checkout@v1.0.0
|
uses: sithlord48/fancy-checkout@v1.0.0
|
||||||
|
|
||||||
- name: Add Kitware repo
|
|
||||||
if: ${{ matrix.distro.name == 'ubuntu-22.04-amd64' }}
|
|
||||||
uses: ./.github/actions/add-kitware-repo
|
|
||||||
with:
|
|
||||||
distro: jammy
|
|
||||||
|
|
||||||
- name: Update CMake
|
|
||||||
if: ${{ matrix.distro.name == 'ubuntu-22.04-amd64' }}
|
|
||||||
run: apt install cmake -y
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
uses: ./.github/actions/install-dependencies
|
||||||
./scripts/install_deps.py
|
with:
|
||||||
env:
|
distro-like: ${{ matrix.distro.like }}
|
||||||
# Prevent apt prompting for input.
|
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -317,11 +285,11 @@ jobs:
|
||||||
${{ matrix.distro.extra-cmake-args }}
|
${{ matrix.distro.extra-cmake-args }}
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
if: ${{ matrix.distro.arch-like != 'true'}}
|
if: ${{ matrix.distro.like != 'arch'}}
|
||||||
run: cmake --build build -j8 --target package
|
run: cmake --build build -j8 --target package
|
||||||
|
|
||||||
- name: Build package (Arch-like)
|
- name: Build package (Arch-like)
|
||||||
if: ${{ matrix.distro.arch-like == 'true' }}
|
if: ${{ matrix.distro.like == 'arch' }}
|
||||||
run: |
|
run: |
|
||||||
cmake --build build -j8
|
cmake --build build -j8
|
||||||
sudo chown -R build build
|
sudo chown -R build build
|
||||||
|
|
|
||||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
|
|
@ -42,10 +42,9 @@ jobs:
|
||||||
uses: sithlord48/fancy-checkout@v1.0.0
|
uses: sithlord48/fancy-checkout@v1.0.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: ./scripts/install_deps.py
|
uses: ./.github/actions/install-dependencies
|
||||||
env:
|
with:
|
||||||
# Prevent apt prompting for input.
|
like: "debian"
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v3
|
uses: github/codeql-action/init@v3
|
||||||
|
|
|
||||||
14
.github/workflows/sonarcloud-analysis.yml
vendored
14
.github/workflows/sonarcloud-analysis.yml
vendored
|
|
@ -25,18 +25,16 @@ jobs:
|
||||||
- name: Fancy Checkout
|
- name: Fancy Checkout
|
||||||
uses: sithlord48/fancy-checkout@v1.0.0
|
uses: sithlord48/fancy-checkout@v1.0.0
|
||||||
|
|
||||||
- name: Add Kitware repo
|
|
||||||
uses: ./.github/actions/add-kitware-repo
|
|
||||||
with:
|
|
||||||
distro: jammy
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
uses: ./.github/actions/install-dependencies
|
||||||
|
with:
|
||||||
|
like: "debian"
|
||||||
|
|
||||||
|
- name: Install dependencies (extra)
|
||||||
|
run: apt install curl unzip gcovr -y
|
||||||
env:
|
env:
|
||||||
# Prevent apt prompting for input.
|
# Prevent apt prompting for input.
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
run: |
|
|
||||||
./scripts/install_deps.py
|
|
||||||
apt install curl unzip cmake gcovr -y
|
|
||||||
|
|
||||||
- name: Install sonar-scanner and build-wrapper
|
- name: Install sonar-scanner and build-wrapper
|
||||||
uses: sonarsource/sonarcloud-github-c-cpp@v3
|
uses: sonarsource/sonarcloud-github-c-cpp@v3
|
||||||
|
|
|
||||||
14
.github/workflows/valgrind-analysis.yml
vendored
14
.github/workflows/valgrind-analysis.yml
vendored
|
|
@ -14,15 +14,13 @@ jobs:
|
||||||
- name: Fancy Checkout
|
- name: Fancy Checkout
|
||||||
uses: sithlord48/fancy-checkout@v1.0.0
|
uses: sithlord48/fancy-checkout@v1.0.0
|
||||||
|
|
||||||
- name: Add Kitware repo
|
|
||||||
uses: ./.github/actions/add-kitware-repo
|
|
||||||
with:
|
|
||||||
distro: jammy
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
uses: ./.github/actions/install-dependencies
|
||||||
./scripts/install_deps.py
|
with:
|
||||||
apt install valgrind cmake -y
|
like: "debian"
|
||||||
|
|
||||||
|
- name: Install valgrind
|
||||||
|
run: apt install valgrind -y
|
||||||
env:
|
env:
|
||||||
# Prevent apt prompting for input.
|
# Prevent apt prompting for input.
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue