-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (74 loc) · 2.63 KB
/
openweather.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
name: openweather_build
env:
main_project_module: app
on:
pull_request:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
OpenWeather:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Get BASE_URL
env:
BASE_URL: $
run: echo BASE_URL=\"$BASE_URL\" > ./local.properties
- name: Get MAPS_API_KEY
env:
MAPS_API_KEY: $
run: echo MAPS_API_KEY=\"$MAPS_API_KEY\" > ./local.properties
- name: Get OPEN_WEATHER_API_KEY
env:
OPEN_WEATHER_API_KEY: $
run: echo OPEN_WEATHER_API_KEY=\"$OPEN_WEATHER_API_KEY\" > ./local.properties
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Run unit tests
run: ./gradlew test --stacktrace
- name: Upload Test Reports Folder
uses: actions/upload-artifact@v2
if: ${{ always() }} # Upload reports regardless of status
with:
name: index.html
path: app/build/reports/tests/testDebugUnitTest/index.html # path to where the xml test results are stored
- name: Android Test Report
uses: asadmansr/android-test-report-action@v1.2.0
if: ${{ always() }}
- name: Build gradle project
run: ./gradlew build
- name: Build apk debug project
run: ./gradlew assembleDebug
- name: Build apk release project
run: ./gradlew assemble
- name: Build app bundle release
run: ./gradlew ${{ env.main_project_module }}:bundleRelease
- name: Upload APK Debug
uses: actions/upload-artifact@v3
with:
name: "openweather_debug_apk"
path: ${{ env.main_project_module }}/build/outputs/apk/debug/
- name: Upload APK Release
uses: actions/upload-artifact@v3
with:
name: "openweather_release_apk"
path: ${{ env.main_project_module }}/build/outputs/apk/release/
- name: Upload AAB Release
uses: actions/upload-artifact@v3
with:
name: "openweather_release_aab"
path: ${{ env.main_project_module }}/build/outputs/bundle/release/