Files
Test-Runner/.gitea/workflows/java-test.yml
thecoderatekid 9185946d7d
Some checks failed
CI Demo / build (push) Successful in 3s
Swift Test / swift-hello (push) Has been cancelled
Java Test / java-hello (push) Has been cancelled
Update .gitea/workflows/java-test.yml
2025-08-07 18:29:05 +00:00

32 lines
868 B
YAML

name: Java Test
on: [push]
jobs:
java-hello:
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Java 17 if missing
run: |
if ! command -v java >/dev/null; then
sudo apt-get update
sudo apt-get install -y openjdk-17-jdk
fi
# Installs OpenJDK 17 from Ubuntu's repos if java isn't on the PATH :contentReference[oaicite:0]{index=0}
- name: Verify Java installation
run: java --version
- name: Compile & run HelloWorld
run: |
cat > HelloWorld.java << 'EOF'
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, Java 17!");
}
}
EOF
javac HelloWorld.java
java HelloWorld