ma img
Some checks failed
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (push) Successful in 11s
checks / Set up Java for Backend Tests and Build (push) Failing after 13s
Gitea Actions Demo / Explore-Gitea-Actions-2 (pull_request) Successful in 2s
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (pull_request) Successful in 11s
checks / Set up Java for Backend Tests and Build (pull_request) Failing after 13s

This commit is contained in:
Patrick
2025-10-31 14:15:46 +01:00
parent 8808556fe1
commit fe818f5f4c

View File

@ -84,6 +84,8 @@ jobs:
backend-jobs:
name: Set up Java for Backend Tests and Build
runs-on: ubuntu-latest
container:
image: ghcr.io/adoptium/temurin:21-jdk
steps:
# Checkout repository
@ -96,38 +98,6 @@ jobs:
git clone --quiet "$CLONE_URL_WITH_AUTH" .
echo "Repository cloned successfully."
# Manual Java 21 installation
- name: Install OpenJDK 21 manually
run: |
set -e
# Detect if running in act
if command -v act >/dev/null 2>&1; then
echo "Detected act runner, installing Java 21 via apt silently..."
fi
# Install prerequisites silently
sudo apt-get update -qq
sudo apt-get install -y -qq wget tar gzip gnupg --no-install-recommends
# Download OpenJDK 21 tar.gz from Eclipse Temurin (or AdoptOpenJDK)
JDK_VERSION="21.0.0+35"
JDK_DIR="/opt/jdk-21"
TMP_TAR="/tmp/openjdk-21.tar.gz"
wget -qO "$TMP_TAR" "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.0%2B35/OpenJDK21U-jdk_x64_linux_hotspot_21.0.0_35.tar.gz"
# Extract silently
sudo mkdir -p "$JDK_DIR"
sudo tar --strip-components=1 -xzf "$TMP_TAR" -C "$JDK_DIR" >/dev/null
# Set environment variables for all steps
echo "JAVA_HOME=$JDK_DIR" | sudo tee /etc/profile.d/jdk21.sh
echo "PATH=$JDK_DIR/bin:\$PATH" | sudo tee -a /etc/profile.d/jdk21.sh
export JAVA_HOME="$JDK_DIR"
export PATH="$JAVA_HOME/bin:$PATH"
java -version
echo "OpenJDK 21 installed successfully."
# Install Maven manually
- name: Install Maven silently
run: |
@ -154,8 +124,7 @@ jobs:
# Run backend tests and build
- name: Test & build backend
working-directory: ./src
run: |
mvn clean verify -B
run: mvn clean verify -B
- name: Done
run: echo "Workflow successfully completed."