-
-
Notifications
You must be signed in to change notification settings - Fork 67
95 lines (93 loc) · 2.7 KB
/
gradle.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Java CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
sonar-and-semantic-release:
runs-on: 'ubuntu-latest'
strategy:
matrix:
gradle: ['7.0', '7.3.3']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
cache: gradle
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: npm
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
./gradlew build --no-daemon
echo Verifying the java version used in class files...
cd build/classes/groovy/main
javap -v com.github.spotbugs.snom.SpotBugsPlugin | grep -q 'major version: 52'
- name: Run Semantic Release
run: |
echo "gradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}" > ~/.gradle/gradle.properties
echo "gradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}" >> ~/.gradle/gradle.properties
rm -rf build/libs/*.jar
npm ci
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run SonarQube Scanner
run: |
if [ "$SONAR_LOGIN" != "" ]; then
./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN --no-daemon
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_LOGIN: ${{ secrets.SONAR_LOGIN }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: reports
path: build/reports
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
gradle: ['7.0', '7.3.3']
os: ['ubuntu-latest', 'windows-latest']
exclude:
# used in the sonar-and-semantic-release job
- gradle: '7.3.3'
os: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
cache: gradle
- name: Build with Gradle
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
./gradlew build --no-daemon "-Dsnom.test.functional.gradle=${{ matrix.gradle }}"
- uses: actions/upload-artifact@v2
if: always()
with:
name: reports (Gradle ${{ matrix.gradle }} on ${{ matrix.os }})
path: build/reports