generated from santimattius/android-basic-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (70 loc) · 2.25 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: Checks
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
detekt:
name: Detekt - Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.head_ref }}
# - name: Create Google Services JSON File
# env:
# GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
# run: echo $GOOGLE_SERVICES_JSON | base64 -di > ./app/google-services.json
- name: Setup API Key
env:
APIKEY: "Hello Secret"
run: echo apiKey="$APIKEY" > ./local.properties
- name: DeteKt
uses: natiginfo/[email protected]
with:
args: --config config/detekt/detekt.yml
tests:
name: Tests
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
# - name: Create Google Services JSON File
# env:
# GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
# run: echo $GOOGLE_SERVICES_JSON | base64 -Dd > ./app/google-services.json
- name: Setup API Key
env:
APIKEY: "Hello Secret"
run: echo apiKey="$APIKEY" > ./local.properties
- name: Run Tests
run: ./gradlew app:testDebugUnitTestCoverage
- name: Generate Report
uses: actions/upload-artifact@v4
with:
name: report
path: app/build/reports/jacoco/testDebugUnitTestCoverage
- name: Download Test Reports Folder
uses: actions/download-artifact@v4
with:
name: report
path: app/build/reports/jacoco/testDebugUnitTestCoverage
- name: Upload Test Report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: app/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml # optional
flags: unittests
name: pull-request
fail_ci_if_error: true
verbose: true