Skip to content

Commit

Permalink
Report junit failures to github
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed Mar 26, 2024
1 parent 605776b commit e3335c6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 13 deletions.
60 changes: 47 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,6 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedCheck

- name: Decode keystore
if: ${{ !github.event.pull_request.head.repo.fork }}
env:
Expand All @@ -115,3 +102,50 @@ jobs:
name: ruffle-release-apks
path: app/build/outputs/apk/release/*.apk

android-tests:
name: Android Tests
needs: build-native-libs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with: # no name set, so all artifacts are downloaded
path: native-libs

- name: Copy native libs
run: |
mkdir app/src/main/jniLibs
cp -r native-libs/*/* app/src/main/jniLibs/
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedCheck

- name: Upload Test Report
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }} # always run even if the previous step fails
with:
name: junit-test-results
path: '**/build/test-results/test/TEST-*.xml'
retention-days: 1

24 changes: 24 additions & 0 deletions .github/workflows/report_test_results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Report test results
on:
workflow_run:
workflows: [build]
types: [completed]

permissions:
checks: write

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Download Test Report
uses: dawidd6/action-download-artifact@v2
with:
name: junit-test-results
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '**/build/test-results/test/TEST-*.xml'

0 comments on commit e3335c6

Please sign in to comment.