generated from admin/template
58 lines
2.1 KiB
YAML
58 lines
2.1 KiB
YAML
name: Detekt
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
detekt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
|
|
- name: Download Detekt CLI
|
|
run: |
|
|
curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.6/detekt-cli-1.23.6-all.jar
|
|
|
|
- name: Run Detekt
|
|
run: |
|
|
java -jar detekt-cli-1.23.6-all.jar \
|
|
--input . \
|
|
--report sarif:detekt-report.sarif \
|
|
--report txt:detekt-report.txt
|
|
continue-on-error: true
|
|
|
|
- name: Show Detekt summary
|
|
run: |
|
|
echo ""
|
|
echo "════════════════════════════════════════"
|
|
echo "📊 Detekt Analysis Complete"
|
|
echo "════════════════════════════════════════"
|
|
echo ""
|
|
TOTAL=$(wc -l < detekt-report.txt)
|
|
echo "Всего нарушений: $TOTAL"
|
|
echo ""
|
|
echo "🔴 Топ-15 проблем:"
|
|
echo "────────────────────────────────────────"
|
|
head -n 15 detekt-report.txt
|
|
echo "────────────────────────────────────────"
|
|
echo ""
|
|
echo "💡 Полный отчёт доступен во вкладке Actions → артефакты"
|
|
echo "════════════════════════════════════════"
|
|
if: always()
|
|
|
|
- name: Upload SARIF report
|
|
uses: github/codeql-action/upload-sarif@v3
|
|
if: always()
|
|
with:
|
|
sarif_file: detekt-report.sarif
|
|
check_name: Detekt |