Skip to content

Commit 7480bb5

Browse files
authored
Create android-ci.yml
1 parent a947ba0 commit 7480bb5

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/android-ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Android CI
2+
3+
env:
4+
# The name of the main module repository
5+
main_project_module: Arms-App
6+
7+
on:
8+
# Triggers the workflow on push or pull request events but only for default and protected branches
9+
push:
10+
branches: [ dev ]
11+
pull_request:
12+
branches: [ dev ]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
jobs:
18+
build:
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
24+
- run: echo "### kickoff build project ${{ github.repository }} :rocket:" >> $GITHUB_STEP_SUMMARY
25+
- uses: actions/checkout@v4
26+
27+
# Set Current Date As Env Variable
28+
- name: Set current date as env variable
29+
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
30+
31+
- name: Build using stored timestamp
32+
run: echo "Building at $date_today"
33+
34+
# Set Repository Name As Env Variable
35+
- name: Set repository name as env variable
36+
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
37+
38+
- name: Set Up JDK
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: 'zulu' # See 'Supported distributions' for available options
42+
java-version: '17'
43+
cache: 'gradle'
44+
45+
- name: Change wrapper permissions
46+
run: chmod +x ./gradlew
47+
48+
# Run Tests Build
49+
- name: Run gradle tests
50+
run: ./gradlew test
51+
52+
# Run Build Project
53+
- name: Build gradle project
54+
run: ./gradlew build
55+
56+
- name: Upload a Build Artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: ArmsApp.apk
60+
path: app/build/outputs/apk/debug/app-debug.apk

0 commit comments

Comments
 (0)