Merge pull request #2 from claymccoy/copilot/use-java-21-lts #10
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: Static Analysis | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| static-analysis: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - name: Run static analysis | |
| run: | | |
| echo "Running basic static analysis..." | |
| ./gradlew build -x test | |
| echo "✅ Build successful - no compilation errors" | |
| echo "Checking for common issues..." | |
| # Check for TODO/FIXME comments | |
| echo "📋 TODO/FIXME comments found:" | |
| find src -name "*.java" -o -name "*.kt" | xargs grep -n -i "todo\|fixme" || echo "None found" | |
| # Check for System.out.println usage (should use logging) | |
| echo "🖨️ System.out.println usage:" | |
| find src -name "*.java" | xargs grep -n "System\.out\.println" || echo "None found (good!)" | |
| # Check for printStackTrace usage | |
| echo "🐛 printStackTrace usage:" | |
| find src -name "*.java" -o -name "*.kt" | xargs grep -n "printStackTrace" || echo "None found (good!)" | |
| echo "✅ Static analysis completed" |