Skip to content

Adding Checkstyle linter #14

Adding Checkstyle linter

Adding Checkstyle linter #14

name: Code Quality Check
on:
push:
branches:
- "master"
- "*-rc"
pull_request:
types: [opened, reopened, synchronize]
branches:
- "**"
jobs:
checkstyle-and-spotless:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # Checkout the branch of the pull request
fetch-depth: 0
- name: List Changed Files
run: |
echo "Current branch: ${{ github.head_ref }}"
echo "Changed files:"
git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }}
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: actions/cache@v4
name: Cache Gradle Wrapper
id: cache-gradle-wrapper
with:
path: |
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
- name: Get Gradle wrapper
if: steps.cache-gradle-wrapper.outputs.cache-hit != 'true'
run: |
./configure.sh
- name: Run Checkstyle
run: |
./gradlew clean rskj-core:checkstyleMain checkstyleTest --info
- name: Run Spotless Check
run: |
./gradlew clean rskj-core:spotlessCheck --info