-
Notifications
You must be signed in to change notification settings - Fork 42
101 lines (95 loc) · 4.06 KB
/
static_analysis.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
96
97
98
99
100
101
name: Static Analysis
on: [pull_request, workflow_dispatch]
concurrency:
group: static-analysis-${{ github.event.number }}
cancel-in-progress: true
jobs:
detekt:
name: Detekt
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'
- name: Run Detekt
run: ./gradlew detekt
android_lint:
name: Android Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'
- name: Lint
run: ./gradlew lint
diffuse:
name: Diffuse AAR Analysis
runs-on: macOS-13
steps:
# Set up environment to assemble SDK
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'
# Assemble artifacts from main branch
- name: Checkout Main Branch
uses: actions/checkout@v4
with:
ref: main
- name: Assemble Release AAR on Main Branch
run: ./gradlew clean assembleRelease -x :Demo:assembleRelease # we exclude Demo module in assemble
- name: Upload Main Branch Artifacts
uses: actions/upload-artifact@v4
with:
name: main-aar
path: |
CorePayments/build/outputs/aar/CorePayments-release.aar
CardPayments/build/outputs/aar/CardPayments-release.aar
PayPalWebPayments/build/outputs/aar/PayPalWebPayments-release.aar
PaymentButtons/build/outputs/aar/PaymentButtons-release.aar
FraudProtection/build/outputs/aar/FraudProtection-release.aar
# Assemble artifacts from current branch
- name: Checkout Current Branch
uses: actions/checkout@v4
- name: Assemble Release AAR on Current Branch
run: ./gradlew clean assembleRelease -x :Demo:assembleRelease # we exclude Demo module in assemble
- name: Upload Current Branch Artifacts
uses: actions/upload-artifact@v4
with:
name: current-aar
path: |
CorePayments/build/outputs/aar/CorePayments-release.aar
CardPayments/build/outputs/aar/CardPayments-release.aar
PayPalWebPayments/build/outputs/aar/PayPalWebPayments-release.aar
PaymentButtons/build/outputs/aar/PaymentButtons-release.aar
FraudProtection/build/outputs/aar/FraudProtection-release.aar
# Set up Diffuse
- name: Install Diffuse
run: brew install JakeWharton/repo/diffuse
- name: Download Workflow Artifacts
uses: actions/download-artifact@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '17'
# Run Diffuse analysis
- name: Run Diffuse Analysis - CardPayments
run: diffuse diff --aar main-aar/CardPayments/build/outputs/aar/CardPayments-release.aar current-aar/CardPayments/build/outputs/aar/CardPayments-release.aar
- name: Run Diffuse Analysis - CorePayments
run: diffuse diff --aar main-aar/CorePayments/build/outputs/aar/CorePayments-release.aar current-aar/CorePayments/build/outputs/aar/CorePayments-release.aar
- name: Run Diffuse Analysis - PayPalWebPayments
run: diffuse diff --aar main-aar/PayPalWebPayments/build/outputs/aar/PayPalWebPayments-release.aar current-aar/PayPalWebPayments/build/outputs/aar/PayPalWebPayments-release.aar
- name: Run Diffuse Analysis - PaymentButtons
run: diffuse diff --aar main-aar/PaymentButtons/build/outputs/aar/PaymentButtons-release.aar current-aar/PaymentButtons/build/outputs/aar/PaymentButtons-release.aar
- name: Run Diffuse Analysis - FraudProtection
run: diffuse diff --aar main-aar/FraudProtection/build/outputs/aar/FraudProtection-release.aar current-aar/FraudProtection/build/outputs/aar/FraudProtection-release.aar