Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
push:
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
branches: [ main ]
paths-ignore:
- docs/**
- '**/*.md'
pull_request:
branches: [ main ]
types: [ opened, reopened, synchronize ]
paths:
- .github/workflows/**
- gradle/**
- kata/**
- build.gradle.kts
- settings.gradle.kts
- gradle.properties
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/kata-pr-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Kata PR Analysis

on:
pull_request:
branches: [ main ]
types: [ opened, reopened, synchronize ]
paths:
- kata/**/*.java
- '!kata/retired/**'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
analysis:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
env:
VERSION: 1.25.0
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Set Gradle tasks
id: changelog
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
echo "Changed files: $CHANGED_FILES"
TASKS=""
for file in $CHANGED_FILES; do
if [[ $file == *.java ]]; then
MODULE=$(echo $file | cut -d'/' -f3)
if [[ ! " $TASKS " =~ " $MODULE " ]]; then
TASKS="$TASKS :$MODULE:test :$MODULE:jacocoTestReport"
fi
fi
done
echo "tasks=$TASKS" >> $GITHUB_OUTPUT

- name: Setup Java
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4
with:
add-job-summary-as-pr-comment: always

- name: Analyze code quality
run: |
./gradlew ${{ steps.changelog.outputs.tasks }} sonar -x processResources -x processTestResources\
--parallel \
--configuration-cache \
--build-cache \
--no-daemon \
--scan \
--no-problems-report \
-Pversion=${{ format('{0}+{1}', env.VERSION, github.RUN_NUMBER) }} \
-Dsonar.organization=${{ secrets.SONAR_KEY }} \
-Dsonar.qualitygate.wait=true \
-Dsonar.gradle.skipCompile=true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Train Kata
name: Kata PR Initialization
run-name: Kata ${{ inputs.kata }}

on:
Expand Down