This commit is contained in:
parent
60a4080c9e
commit
f9fdccbbf7
1 changed files with 39 additions and 0 deletions
39
.forgejo/workflows/test.yaml
Normal file
39
.forgejo/workflows/test.yaml
Normal file
|
@ -0,0 +1,39 @@
|
|||
name: Android Test
|
||||
|
||||
on:
|
||||
push: {}
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: debian
|
||||
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure SDK path
|
||||
run: echo "sdk.dir=/opt/android-sdk" > local.properties
|
||||
|
||||
- name: Check Java version
|
||||
run: |
|
||||
if ! command -v java >/dev/null; then
|
||||
echo "❌ Java is not installed"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ Java version:"
|
||||
java -version
|
||||
|
||||
- name: Extract version from build.gradle
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(sed -nE 's/^[[:space:]]*versionName[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' app/build.gradle)
|
||||
VERSION="v${VERSION#v}" # normalize to vX.Y.Z
|
||||
echo "$VERSION" > version.txt
|
||||
echo "✅ Detected version: $VERSION"
|
||||
|
||||
- name: Set up gradle
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
- name: Run tests
|
||||
run: ./gradlew testDebugUnitTest
|
Loading…
Add table
Add a link
Reference in a new issue