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

This commit is contained in:
Patrick
2025-10-31 13:55:55 +01:00
parent dcde1bd0df
commit 830d05dc9d

View File

@ -86,59 +86,63 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Checkout repository first # Checkout repository
- name: Checkout repository manually - name: Checkout repository manually
env: env:
TOKEN: ${{ secrets.ACCESS_TOKEN }} TOKEN: ${{ secrets.ACCESS_TOKEN }}
CLONE_URL: ${{ vars.CLONE_URL }} CLONE_URL: ${{ vars.CLONE_URL }}
run: | run: |
echo "Cloning from $CLONE_URL" CLONE_URL_WITH_AUTH=$(echo "$CLONE_URL" | sed "s#https://#https://$TOKEN@#")
echo "Cloning ALL_REPO_TOKEN $ALL_REPO_TOKEN"
CLONE_URL_WITH_AUTH=$(echo "$CLONE_URL" | sed "s#https://#https://$ALL_REPO_TOKEN@#")
git clone --quiet "$CLONE_URL_WITH_AUTH" . git clone --quiet "$CLONE_URL_WITH_AUTH" .
echo "${{ gitea.repository }} cloned successfully." echo "Repository cloned successfully."
- name: Set up Java 21 and Maven # Manual Java 21 installation
- name: Install OpenJDK 21 manually
run: | run: |
set -e
# Detect if running in act
if command -v act >/dev/null 2>&1; then if command -v act >/dev/null 2>&1; then
echo "Detected act runner, installing OpenJDK 21 via apt-get..." echo "Detected act runner, installing Java 21 via apt silently..."
sudo apt-get update
sudo apt-get install -y openjdk-21-jdk maven
else
echo "Detected GitHub runner, using actions/setup-java..."
fi fi
shell: bash
- uses: actions/checkout@v5 # Install prerequisites silently
- name: Set up JDK 21 for x64 sudo apt-get update -qq
uses: actions/setup-java@v4 sudo apt-get install -y -qq wget tar gzip gnupg --no-install-recommends
with:
java-version: '21'
distribution: 'oracle'
architecture: x64
cache: maven
cache-dependency-path: 'pom.xml' # optional
- name: Setup Java 21 (for act) # Download OpenJDK 21 tar.gz from Eclipse Temurin (or AdoptOpenJDK)
run: | JDK_VERSION="21.0.0+35"
# Ensure keyrings are updated JDK_DIR="/opt/jdk-21"
apt-get update -y --allow-unauthenticated || true TMP_TAR="/tmp/openjdk-21.tar.gz"
apt-get install -y --no-install-recommends wget gnupg software-properties-common 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"
# Add the missing public key # Extract silently
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C || true 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"
# Update sources and install Java 21
apt-get update -y
apt-get install -y openjdk-21-jdk
java -version java -version
echo "Java 21 setup completed." echo "OpenJDK 21 installed successfully."
- name: Set up Maven # Install Maven manually
uses: stCarolas/setup-maven@v5 - name: Install Maven silently
with: run: |
maven-version: 3.9.9 MAVEN_VERSION="3.9.9"
MAVEN_DIR="/opt/maven"
wget -qO /tmp/apache-maven.tar.gz "https://downloads.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz"
sudo mkdir -p "$MAVEN_DIR"
sudo tar -xzf /tmp/apache-maven.tar.gz --strip-components=1 -C "$MAVEN_DIR" >/dev/null
echo "MAVEN_HOME=$MAVEN_DIR" | sudo tee /etc/profile.d/maven.sh
echo "PATH=$MAVEN_DIR/bin:\$PATH" | sudo tee -a /etc/profile.d/maven.sh
export MAVEN_HOME="$MAVEN_DIR"
export PATH="$MAVEN_HOME/bin:$PATH"
mvn -v
# Cache Maven dependencies
- name: Cache Maven dependencies - name: Cache Maven dependencies
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -147,14 +151,11 @@ jobs:
restore-keys: | restore-keys: |
maven-${{ runner.os }}- maven-${{ runner.os }}-
# Run backend tests and build
- name: Test & build backend - name: Test & build backend
working-directory: ./src working-directory: ./src
run: | run: |
echo "Started test & build backend..." mvn clean verify -B
ls .
mvn clean
echo "Backend tests and build completed successfully."
# mvn clean verify package -B
- name: Done - name: Done
run: echo "Workflow successfully completed." run: echo "Workflow successfully completed."