Skip to content

Commit b57bced

Browse files
authored
Merge pull request #69 from vernu/build-android
build android debug artifacts on push
2 parents 0952c84 + 80354f7 commit b57bced

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

.github/workflows/build-and-test.yaml

+46-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- 'api/**'
77
- 'web/**'
8+
- 'android/**'
89
- '.github/workflows/build-and-test.yaml'
910

1011
workflow_dispatch:
@@ -16,8 +17,8 @@ on:
1617
type: string
1718

1819
jobs:
19-
build-and-test:
20-
name: Build and Test
20+
build-and-test-web-and-api:
21+
name: Build and Test web and api
2122
runs-on: ubuntu-latest
2223

2324
steps:
@@ -62,4 +63,46 @@ jobs:
6263
cd web
6364
pnpm install
6465
pnpm run prisma:generate
65-
pnpm run build
66+
pnpm run build
67+
68+
build-and-test-android:
69+
name: Build and Test Android
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout repository
74+
uses: actions/checkout@v4
75+
with:
76+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }}
77+
78+
- name: Set up JDK 17
79+
uses: actions/setup-java@v3
80+
with:
81+
java-version: '17'
82+
distribution: 'temurin'
83+
cache: gradle
84+
85+
- name: Setup Gradle
86+
uses: gradle/gradle-build-action@v2
87+
with:
88+
gradle-version: '7.2'
89+
90+
- name: Grant execute permission for gradlew
91+
run: chmod +x android/gradlew
92+
93+
- name: Build Android app
94+
run: |
95+
cd android
96+
./gradlew assembleDebug
97+
98+
# - name: Run Android tests
99+
# run: |
100+
# cd android
101+
# ./gradlew testDebugUnitTest
102+
103+
- name: Upload build artifacts
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: textbee.dev-build-${{ github.ref_name }}-${{ github.sha }}.apk
107+
path: android/app/build/outputs/apk/debug/app-debug.apk
108+
retention-days: 7

0 commit comments

Comments
 (0)