Skip to content

Commit 8af8a4a

Browse files
committed
CI: Run Kotlin tests on GitHub actions
1 parent 920651f commit 8af8a4a

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,65 @@ jobs:
321321
make build-python-wheel GLEAN_BUILD_TARGET="$target" GLEAN_BUILD_EXTRA="--zig"
322322
done
323323
324+
test-kotlin:
325+
runs-on: ubuntu-latest
326+
needs: [decide-runs]
327+
if: needs.decide-runs.outputs.rust-changed == 'true' || needs.decide-runs.outputs.kotlin-changed == 'true'
328+
steps:
329+
- *checkout
330+
331+
- name: Set up Rust
332+
uses: dtolnay/rust-toolchain@stable
333+
334+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
335+
336+
- name: Set up JDK 17
337+
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
338+
with:
339+
java-version: '17'
340+
distribution: 'temurin'
341+
342+
- name: Setup Android SDK
343+
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
344+
with:
345+
accept-android-sdk-licenses: true
346+
log-accepted-android-sdk-licenses: false
347+
348+
- name: Install Android NDK
349+
run: |
350+
sdkmanager "ndk;29.0.14206865"
351+
352+
- name: Restrict to Linux builds only
353+
run: |
354+
echo "rust.targets=linux-x86-64" > local.properties
355+
356+
- name: Test
357+
run: |
358+
export GRADLE_OPTS="-Xmx2048m"
359+
export TARGET_CFLAGS="-DNDEBUG"
360+
./gradlew --no-daemon :glean:testDebugUnitTest
361+
362+
- name: Build Android Sample App
363+
run: |
364+
export GRADLE_OPTS="-Xmx2048m"
365+
export TARGET_CFLAGS="-DNDEBUG"
366+
./gradlew :glean-sample-app:assembleAndroidTest
367+
368+
- name: Save test results
369+
if: failure()
370+
run: |
371+
mkdir -p test-results/junit/
372+
mkdir -p test-results/tests/
373+
cp -a glean-core/android/build/reports/tests test-results/
374+
find glean-core/android/build -type f -regex ".*/build/test-results/.*xml" -exec cp {} test-results/junit/ \;
375+
376+
- name: Upload test results
377+
if: failure()
378+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
379+
with:
380+
name: gradle-test-failures
381+
path: test-results/tests
382+
324383
lint-yaml:
325384
runs-on: ubuntu-latest
326385
needs: [decide-runs]

0 commit comments

Comments
 (0)