Skip to content

23.2

23.2 #65

name: Java Workflow
on:
push:
branches:
- main
- master
- develop
paths-ignore:
- readme.md
- README.md
- CHANGELOG.md
pull_request:
types: [opened, synchronize, reopened]
jobs:
reviewdog:
if: contains(fromJSON('["reportportal/service-api", "reportportal/commons-dao", "reportportal/service-authorization", "reportportal/service-jobs", "reportportal/commons-model"]'), github.repository)
runs-on: ubuntu-latest
name: Java Checkstyle
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Run checkstyle
uses: nikitasavinov/checkstyle-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-review'
sonarcloud:
if: contains(fromJSON('[""]'), github.repository)
runs-on: ubuntu-latest
name: SonarCloud
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Report test coverage
run: ./gradlew test jacocoTestReport
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info