add frontend and backend jobs
All checks were successful
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) Successful in 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) Successful in 11s

This commit is contained in:
Patrick
2025-10-31 17:31:39 +01:00
parent 04edd6f025
commit 9b4102f474
4 changed files with 15 additions and 299 deletions

View File

@ -1,14 +1,17 @@
name: checks
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
frontend-jobs:
name: Set up Node and other necessary dependencies for Frontend Tests and Build
Explore-Gitea-Actions-2:
runs-on: ubuntu-latest
steps:
- name: Info
run: |
@ -61,68 +64,12 @@ jobs:
git clone --quiet "$CLONE_URL_WITH_AUTH" .
echo "${{ gitea.repository }} cloned successfully."
# Install frontend dependencies and run tests
- name: Install frontend dependencies and run tests
#uses: actions/cache@v3
working-directory: ./frontend
with:
path: |
~/.yarn/cache
./node_modules
key: frontend-${{ runner.os }}-yarn-${{ hashFiles('frontend/yarn.lock') }}
restore-keys: |
frontend-${{ runner.os }}-yarn-
- name: List repo files
run: |
yarn install --frozen-lockfile
#yarn test --watchAll=false --ci
#Check frontend linting
- name: Check frontend linting
working-directory: ./frontend
run: yarn lint
backend-jobs:
name: Set up Java for Backend Tests and Build
runs-on: ubuntu-latest
#container:
#image: eclipse-temurin:21-jdk
steps:
# Install Maven manually
- name: Checkout code
uses: actions/checkout@v4
# 1⃣ Download OpenJDK 21 (example source URL)
- name: Download 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
# 2⃣ Setup Java from local JDK file
- 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
tar -xzf $RUNNER_TEMP/java_package.tar.gz -C $RUNNER_TEMP/jdk --strip-components=1
echo "JAVA_HOME=$RUNNER_TEMP/jdk" >> $GITHUB_ENV
echo "$RUNNER_TEMP/jdk/bin" >> $GITHUB_PATH
# 3⃣ Verify Java installation
- name: Verify Java setup
run: |
#java -version
java
echo "JAVA_HOME=$JAVA_HOME"
# 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
run: mvn clean verify -B
ls .
node -v
npm -v
yarn -v
- name: Done
run: echo "Workflow successfully completed."
run: echo "Workflow finished."