ma jdk ch 21
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 3s
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (pull_request) Successful in 10s
checks / Set up Java for Backend Tests and Build (pull_request) Failing after 12s

This commit is contained in:
Patrick
2025-10-31 15:46:03 +01:00
parent 1157f0eeea
commit 54c8949856

View File

@ -88,45 +88,25 @@ jobs:
#image: eclipse-temurin:21-jdk
steps:
- name: Setup Java 21 manually
run: |
download_url="https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz"
wget -q -O /tmp/jdk.tar.gz $download_url
mkdir -p /opt/jdk
tar -xzf /tmp/jdk.tar.gz -C /opt/jdk --strip-components=1
echo "JAVA_HOME=/opt/jdk" >> $GITHUB_ENV
echo "/opt/jdk/bin" >> $GITHUB_PATH
- name: Set up Java 21 (Temurin)
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache-dependency-path: 'pom.xml' # optional
cache: 'maven'
package: 'maven'
- name: Verify Java setup
run: |
java -version
# Install Maven manually
- name: Download and extract OpenJDK 21
run: |
download_url="https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz"
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
mkdir -p $RUNNER_TEMP/jdk-extracted
tar -xzf $RUNNER_TEMP/java_package.tar.gz -C $RUNNER_TEMP/jdk-extracted
# Detect the inner directory name (e.g., jdk-21.0.1)
extracted_dir=$(find $RUNNER_TEMP/jdk-extracted -maxdepth 1 -type d -name "jdk*" | head -n 1)
echo "Detected JDK directory: $extracted_dir"
echo "JAVA_HOME=$extracted_dir" >> $GITHUB_ENV
echo "$extracted_dir/bin" >> $GITHUB_PATH
- name: Verify Java setup
run: |
ls -l $JAVA_HOME/bin/java
file $JAVA_HOME/bin/java || true
java -version
# 4⃣ Build and test with Maven
- name: Build with Maven
run: mvn -B verify
# Run backend tests and build
- name: Test & build backend
working-directory: ./src