forked from joseeliaschavez/java-rest-api-template
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.11 KB
/
Copy pathgradle.yml
File metadata and controls
76 lines (63 loc) · 2.11 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop", "feature/**", "story/**", "bugfix/**", "devops/**" ]
permissions:
checks: write
contents: read
security-events: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Build and Unit Test with Gradle
run: ./gradlew spotlessCheck test spotbugsMain pmdMain pmdTest
- name: Run Integration Tests
env:
TMDB_API_TOKEN: ${{ secrets.TMDB_API_TOKEN }}
run: ./gradlew integrationTest
- name: SpotBugs Report
uses: lcollins/spotbugs-github-action@v3.0.0
with:
path: 'build/reports/spotbugs/main.xml'
- name: PMD Report
uses: pmd/pmd-github-action@v2
with:
rulesets: 'pmd-ruleset.xml'
analyzeModifiedFilesOnly: false
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: pmd-report.sarif
category: pmd
- name: Jacoco Coverage Report
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
with:
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
title: 'JaCoCo Report'
min-coverage-overall: 40
min-coverage-changed-files: 60
pass-emoji: ':white_check_mark:'
fail-emoji: ':x:'