-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.8 KB
/
pull_request_merge.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
name: Pull Request / Merge
# Manual trigger for the workflow
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch:
permissions:
contents: read # Grants read-only access to the repository contents
packages: read # Grants read-only access to GitHub packages
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT }}
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/[email protected]
# Set up JDK 17
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
# Install dependencies (optional: you can skip if it's handled elsewhere)
- name: Set up Gradle cache
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
# Run Lint checks
- name: Run Android Lint
run: ./gradlew lint
# Run Unit tests
- name: Run Unit tests
run: ./gradlew test
- name: Run Gradle Jacoco Report
run: ./gradlew jacocoTestReport
- name: Upload to Codecov
uses: codecov/[email protected]
with:
files: build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Send Slack Message
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"Android Mobile SDK PR/Merge job finished with status: ${{ job.status }}"}' ${{ secrets.SLACK_WEBHOOK_URL }}