From 52f0e2e63a736cf3de969719588a9c055286c754 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 31 Oct 2025 11:00:00 +0100 Subject: [PATCH] install deps --- .gitea/workflows/test.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 3e61fc0..57d0fd9 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -110,18 +110,38 @@ jobs: shell: bash - name: Install OpenJDK 21 + shell: bash run: | - # Ensure apt and necessary tools are available + set -e + + # Check if apt-get exists; if not, install it + if ! command -v apt-get &> /dev/null; then + echo "apt-get not found. Attempting to install..." + if command -v apk &> /dev/null; then + echo "Using apk to install apt (Alpine detected)..." + apk update + apk add --no-cache apt + elif command -v dnf &> /dev/null; then + echo "Using dnf (Fedora/RHEL detected)..." + dnf install -y apt + elif command -v yum &> /dev/null; then + echo "Using yum (CentOS/RHEL detected)..." + yum install -y apt + else + echo "No supported package manager found!" + exit 1 + fi + fi + + # Continue installation using apt-get apt-get update -y apt-get install -y apt-transport-https ca-certificates curl gnupg wget software-properties-common - # Download and install OpenJDK 21 (Oracle version) + # Download and install Oracle JDK 21 wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb - - # Install the downloaded package apt install -y ./jdk-21_linux-x64_bin.deb - # Verify installation + # Verify installation java -version - uses: actions/checkout@v5