-
Notifications
You must be signed in to change notification settings - Fork 26
50 lines (49 loc) · 1.93 KB
/
verify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Verify source code changes
on:
push:
branches: [master]
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@v4
- name: Get changed source files or maven poms of all modules
id: changed-files-specific
uses: tj-actions/changed-files@v39
with:
files: |
pom.xml
.mvn/**
.github/workflows/verify.yml
plantuml-generator-util/pom.xml
plantuml-generator-util/src/main/**
plantuml-generator-util/src/test/**
plantuml-generator-maven-plugin/pom.xml
plantuml-generator-maven-plugin/src/main/**
plantuml-generator-maven-plugin/src/test/**
plantuml-generator-maven-plugin/src/it/**
- 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: Analyze with SonarCloud
if: ${{steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name != 'pull_request'}}
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_plantuml-generator -Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Verify via Maven without SonarCloud
if: ${{steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request'}}
run: ./mvnw -B install verify
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}