ci: update CI workflows to include path filters #73
1 changed files with 26 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue