Create java-ci.yml #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Compile all Java files | |
| run: | | |
| echo "Compiling Java source..." | |
| find . -name "*.java" > sources.txt | |
| if [ -s sources.txt ]; then | |
| javac @sources.txt | |
| echo "Compilation successful." | |
| else | |
| echo "No Java files found." | |
| fi |