This GitHub Action performs comprehensive static analysis checks on a Kotlin Multiplatform (KMP) project. It ensures code quality, formatting, and dependency management through multiple verification steps.
- name: Static Analysis Check
uses: openMF/[email protected]
- Kotlin Multiplatform project
- Gradle build system
- Java 17
- Configured Gradle project
- Spotless plugin
- Detekt plugin
- Dependency Guard plugin
- Uses Zulu OpenJDK distribution
- Configures Java 17 development environment
- Sets up Gradle build system
- Configures caching for improved build performance
- Caches Gradle dependencies and build outputs
- Uses runner OS and Gradle configuration hash as cache key
- Speeds up subsequent build processes
- Runs configuration checks on build logic
- Command:
./gradlew check -p build-logic
- Uses Spotless to check code formatting
- Command:
./gradlew spotlessCheck
- Flags:
--no-configuration-cache
--no-daemon
- Runs Detekt for static code analysis
- Command:
./gradlew detekt
- Checks project dependencies
- Command:
./gradlew dependencyGuard
- Uploads Detekt analysis reports as artifacts
- Conditional upload based on Detekt check success
- Stores reports in
**/build/reports/detekt/detekt.md
name: Static Analysis
on: [ push, pull_request ]
jobs:
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Static Analysis Check
uses: openMF/[email protected]
- Ensures code quality
- Maintains consistent code formatting
- Identifies potential code smells and vulnerabilities
- Manages dependency integrity
- Provides detailed analysis reports