-
-
Notifications
You must be signed in to change notification settings - Fork 68
71 lines (69 loc) · 2.42 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
name: Java CI
on:
push:
branches:
- master
pull_request: {}
workflow_dispatch: {}
jobs:
build:
strategy:
fail-fast: false
matrix:
gradle: [ '7.6.4', '8.1', 'current' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: webiny/[email protected]
if: github.event_name == 'pull_request'
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version-file: .java-version
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
if: matrix.gradle == '7.6.4' && matrix.os == 'ubuntu-latest'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build the project
run: ./gradlew build -P"snom.test.functional.gradle=${{ matrix.gradle }}" --scan
- name: Verify class files
if: matrix.os == 'ubuntu-latest'
run: |
echo "$PATH"
echo "Verifying the java version used in class files..."
cd build/classes/kotlin/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
if: matrix.gradle == '7.6.4' && matrix.os == 'ubuntu-latest' && github.repository == 'spotbugs/spotbugs-gradle-plugin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
- name: Run SonarQube Scanner
run: |
if [ "$SONAR_LOGIN" != "" ]; then
./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN --no-daemon
fi
if: matrix.gradle == '7.6.4' && matrix.os == 'ubuntu-latest' && github.repository == 'spotbugs/spotbugs-gradle-plugin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_LOGIN: ${{ secrets.SONAR_LOGIN }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: reports (Gradle ${{ matrix.gradle }}, ${{ matrix.os }})
path: build/reports