-
-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (60 loc) · 2.02 KB
/
build.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
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
# https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables
name: build
on:
workflow_dispatch:
push:
# branches:
# - master
# - develop
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout sources
uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
# https://github.com/marketplace/actions/gradle-build-action
- name: Gradle build
uses: gradle/gradle-build-action@v2.4.2
# with:
# gradle-version: 7.6.2
# arguments: test build
#
# - name: Setup build cache
# uses: actions/cache@v2
# with:
# path: ~/.gradle/caches
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: Grant execute permission to gradlew
# run: chmod +x gradlew
- name: Build with gradle wrapper
run: ./gradlew test build
# - name: Publish GitHub Packages
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# run: ./gradlew publish
- name: Analyse with Sonar
# run: ./gradlew test jacocoTestReport sonar
run: ./gradlew jacocoTestReport sonar
# uses: gradle/gradle-build-action@v2
# with:
# gradle-version: 7.6.2
# arguments: jacocoTestReport sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}