-
Notifications
You must be signed in to change notification settings - Fork 63
56 lines (48 loc) · 1.58 KB
/
android.yml
File metadata and controls
56 lines (48 loc) · 1.58 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
name: Build, Analyze, and Upload to Pocket Deploy
on:
workflow_dispatch:
inputs:
branch_name:
description: 'Branch to checkout'
required: false
default: 'feature/integrate_sonar_qube'
jobs:
build-and-analyze-upload:
name: Build, Analyze, and Upload to Pocket Deploy
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the specified branch
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: feature/integrate_sonar_qube
# Step 2: Set up Java environment
- name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
# Step 3: Grant execute permission to Gradle wrapper
- name: Grant Execute Permission to Gradle
run: chmod +x ./gradlew
# Step 4: Cache SonarQube packages
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
# Step 5: Cache Gradle packages
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
# Step 6: Build and analyze with SonarQube
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew build sonar --info