ci: update CI workflows to include path filters #73

Merged
jank merged 4 commits from pipeline-rules into main 2025-03-13 09:04:46 +00:00
Showing only changes of commit 0227146da7 - Show all commits

ci: improve checkstyle report caching in CI workflow
All checks were successful
CI / Get Changed Files (pull_request) Successful in 7s
CI / prettier (pull_request) Successful in 19s
CI / eslint (pull_request) Successful in 21s
CI / test-build (pull_request) Successful in 28s
CI / Checkstyle Main (pull_request) Successful in 37s

Jan K9f 2025-03-12 21:08:49 +01:00
Signed by: jank
GPG key ID: 22BEAC760B3333D6

View file

@ -40,16 +40,36 @@ jobs:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-common
backend/build/reports/checkstyle
key: gradle-${{ runner.os }}-${{ hashFiles('backend/**/*.java', 'backend/config/checkstyle/checkstyle.xml') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: "Prepare Gradle"
- name: "Check cache for checkstyle reports"
id: check-cache
run: |
if [ -d "backend/build/reports/checkstyle" ] && [ -f "backend/build/reports/checkstyle/main.xml" ]; then
echo "Cache hit! Using cached checkstyle results"
echo "cache-hit=true" >> $GITHUB_OUTPUT
else
echo "Cache miss! Running checkstyle check"
echo "cache-hit=false" >> $GITHUB_OUTPUT
fi
- name: "Run checkstyle"
if: steps.check-cache.outputs.cache-hit != 'true'
working-directory: ./backend
run: gradle clean
- name: "Check"
working-directory: ./backend
run: gradle checkstyleMain
run: |
gradle checkstyleMain
- name: "Cache checkstyle results"
if: steps.check-cache.outputs.cache-hit != 'true'
uses: actions/upload-artifact@v4
with:
name: checkstyle-results
path: backend/build/reports/checkstyle
- name: "Stop Gradle"
if: steps.check-cache.outputs.cache-hit != 'true'
working-directory: ./backend
run: gradle --stop