name: Gradle Test

on:
    push:
        branches:
            - "*" # Runs on all branches

jobs:
    test:
        runs-on: docker
        container:
            image: data.forgejo.org/oci/node:20-bullseye
            options: "--user root"
        steps:
            - name: Checkout repository
              uses: actions/checkout@v4

            - name: Install JDK 17 Manually
              run: |
                  apt update
                  apt install -y openjdk-17-jdk
                  java -version

            - name: Grant execute permission for Gradle wrapper
              run: chmod +x gradlew

            - name: Run Gradle tests
              run: ./gradlew test
