-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (93 loc) · 2.95 KB
/
pull-request.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
102
103
104
105
106
107
108
109
110
111
112
113
name: Pull Request
on:
pull_request:
branches: [ master ]
env:
ORG_GRADLE_PROJECT_com.basistheory.android.example.apiUrl: https://api.flock-dev.com
ORG_GRADLE_PROJECT_com.basistheory.android.example.apiKey: ${{ secrets.BASIS_THEORY_API_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK version
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- name: Setup Gradle cache
uses: gradle/[email protected]
- name: Build modules
run: ./gradlew build -x test
- name: Run unit tests
run: ./gradlew testDebugUnitTest
acceptance:
runs-on: macos-latest
strategy:
matrix:
api-level: [ 29 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK version
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- name: Setup Gradle cache
uses: gradle/[email protected]
- name: Setup AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
target: default
arch: x86_64
profile: pixel_3a
script: echo "Generated AVD snapshot for caching."
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
target: default
arch: x86_64
profile: pixel_3a
script: ./gradlew connectedCheck
code-security:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_API_KEY }}
with:
command: code test
dependencies-security:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_API_KEY }}
with:
args: --all-sub-projects --severity-threshold=high