ci(tests): install dependencies via the host package manager
tests / build-test (push) Has been cancelled
tests / build-test (push) Has been cancelled
Host-mode runners execute jobs directly on the runner machine, so apt fails on non-Debian hosts. Detect pacman/apt/dnf so the test workflow runs on any Linux host, and pull in git as a safety net for checkout. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 file changed
+17
-3
@@ -20,9 +20,23 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
cmake g++ make qt6-base-dev
|
||||
# Host-mode runners execute jobs directly on the runner machine, so
|
||||
# detect its package manager instead of hardcoding apt (which only
|
||||
# exists on Debian/Ubuntu hosts).
|
||||
if command -v pacman >/dev/null 2>&1; then
|
||||
sudo pacman -S --noconfirm --needed \
|
||||
git cmake gcc make qt6-base
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
git cmake g++ make qt6-base-dev
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
sudo dnf install -y \
|
||||
git cmake gcc-c++ make qt6-qtbase-devel
|
||||
else
|
||||
echo "Unsupported package manager: install git, cmake, a C++ compiler, make and Qt6 manually" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
|
||||
Reference in new issue
Block a user