-
Notifications
You must be signed in to change notification settings - Fork 27
85 lines (83 loc) · 3.09 KB
/
pull_request_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: Pull Request Checker
on:
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.txt'
- '.github/**'
- '!.github/workflows/**'
jobs:
build:
name: Pull Request Check
if: ${{ success() }}
runs-on: ubuntu-latest
env:
MODULE_APK_OUTPUT_PATH: 'module-app/build/outputs/apk'
DEMO_APK_OUTPUT_PATH: 'demo-app/build/outputs/apk'
steps:
- uses: actions/checkout@v3
- name: Prepare GitHub Env
run: |
GITHUB_SHA=${{ github.sha }}
GITHUB_CI_COMMIT_ID=${GITHUB_SHA:0:7}
echo "GITHUB_CI_COMMIT_ID=$GITHUB_CI_COMMIT_ID" >> $GITHUB_ENV
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: '3.22.1'
- name: Prepare Java 17
uses: actions/setup-java@v3
with:
java-version: 17
java-package: jdk
distribution: 'temurin'
cache: 'gradle'
- name: Cache Gradle Dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }}
restore-keys: |
gradle-deps
- name: Cache Gradle Build
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/build-cache-*
key: gradle-builds-core-${{ github.sha }}
restore-keys: |
gradle-builds
- name: Build with Gradle
run: |
./gradlew :module-app:assembleDebug
./gradlew :module-app:assembleRelease
./gradlew :demo-app:assembleDebug
./gradlew :demo-app:assembleRelease
echo "MODULE_DEBUG_APK_PATH=$(find ${{ env.MODULE_APK_OUTPUT_PATH }}/debug -name '*.apk')" >> $GITHUB_ENV
echo "MODULE_RELEASE_APK_PATH=$(find ${{ env.MODULE_APK_OUTPUT_PATH }}/release -name '*.apk')" >> $GITHUB_ENV
echo "DEMO_DEBUG_APK_PATH=$(find ${{ env.DEMO_APK_OUTPUT_PATH }}/debug -name '*.apk')" >> $GITHUB_ENV
echo "DEMO_RELEASE_APK_PATH=$(find ${{ env.DEMO_APK_OUTPUT_PATH }}/release -name '*.apk')" >> $GITHUB_ENV
- name: Upload Artifacts (Module-Debug)
uses: actions/upload-artifact@v3
with:
path: ${{ env.MODULE_DEBUG_APK_PATH }}
name: AppErrorsTracking-module-debug-${{ github.event.head_commit.id }}
- name: Upload Artifacts (Module-Release)
uses: actions/upload-artifact@v3
with:
path: ${{ env.MODULE_RELEASE_APK_PATH }}
name: AppErrorsTracking-module-release-${{ github.event.head_commit.id }}
- name: Upload Artifacts (Demo-Debug)
uses: actions/upload-artifact@v3
with:
path: ${{ env.DEMO_DEBUG_APK_PATH }}
name: AppErrorsTracking-demo-debug-${{ github.event.head_commit.id }}
- name: Upload Artifacts (Demo-Release)
uses: actions/upload-artifact@v3
with:
path: ${{ env.DEMO_RELEASE_APK_PATH }}
name: AppErrorsTracking-demo-release-${{ github.event.head_commit.id }}