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

32 lines
872 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 Ubuntus repos if java isnt 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