Skip to content

Merge pull request #13 from renovate-bot/renovate/junit5-monorepo #70

Merge pull request #13 from renovate-bot/renovate/junit5-monorepo

Merge pull request #13 from renovate-bot/renovate/junit5-monorepo #70

Workflow file for this run

name: Verify source code changes
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
name: Verify source code changes on Java ${{ matrix.Java }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Get changed source files or maven poms of all modules
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
files: |
pom.xml
.mvn/**
.github/workflows/verify.yml
src/main/**
src/test/**
- name: Set up JDK
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Cache SonarCloud packages
if: ${{steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name != 'pull_request'}}
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Analyze with SonarCloud
if: ${{steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name != 'pull_request'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B install verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.coverage.jacoco.xmlReportPaths=\${project.build.directory}/site/jacoco/jacoco.xml -Dsonar.projectKey=devlauer_jndi-provider
- name: Verify via Maven without SonarCloud
if: ${{steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./mvnw -B install verify