-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 1.73 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
name: CI
on:
pull_request:
branches:
- 'develop'
push:
branches:
- 'develop'
jobs:
cancel-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
static-check:
runs-on: ubuntu-latest
needs: cancel-workflow
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'adopt'
- name: Clean build
run: ./gradlew clean
- name: Run ktlintDebug
run: ./gradlew ktlintMainSourceSetCheck
- name: Upload ktlint report
uses: actions/upload-artifact@v2
if: failure()
with:
name: ktlint-result
path: ./**/build/reports/ktlint/**/*.html
build:
runs-on: ubuntu-latest
needs: static-check
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'adopt'
- name: Clean build
run: ./gradlew clean
- name: Setup google-services.json (Staging)
run: |
mkdir -p ./app/src/staging
cat << EOF > ./app/src/staging/google-services.json
${{ secrets.google_services_json_staging }}
EOF
- name: Setup secrets.xml (Staging)
run: |
mkdir -p ./app/src/staging/res/values
cat << EOF > ./app/src/staging/res/values/secrets.xml
${{ secrets.secrets_xml_staging }}
EOF
- name: Build debug APK
run: ./gradlew assembleStagingDebug --stacktrace