-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (80 loc) · 2.91 KB
/
ci.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
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
api-level: [ 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29 ]
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Install JDK 11
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: Build
run: ./gradlew build -PciApiLevel=${{ matrix.api-level }} --stacktrace
- name: Report Detekt results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ github.workspace }}/build/detekt/sarif
checkout_path: ${{ github.workspace }}
- name: Install HAXM
run: brew install --cask intel-haxm
- name: Emulator cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: Create emulator 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: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Instrumented 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
disable-animations: true
script: ./gradlew connectedCheck -PciApiLevel=${{ matrix.api-level }} --stacktrace
- name: Publish test results
uses: mikepenz/[email protected]
if: success() || failure()
with:
check_name: Android test report for API ${{ matrix.api-level }}
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: "**/build/outputs/androidTest-results/connected/**/TEST-*.xml"
scan_for_secrets:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
# Allows Gitleaks to scan the commit history of a whole PR:
fetch-depth: '0'
- name: Fetch Gitleaks rules
uses: wei/wget@v1
with:
args: -O .rules.toml https://raw.githubusercontent.com/fnxpt/gitleaks-action/rules/.rules.toml
- name: Gitleaks
uses: zricethezav/[email protected]
with:
config-path: .rules.toml