Skip to content

Commit

Permalink
Update Github workflow configurations 🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Jul 29, 2024
1 parent a13ae14 commit 01e91a9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 14 deletions.
39 changes: 34 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

runs-on: macos-13
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [34]

steps:
- name: Cancel Previous workflow runs
Expand All @@ -31,6 +34,12 @@ jobs:
distribution: temurin
java-version: 17

- 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: Create local.properties file
run: touch local.properties && echo "mapbox.repo.token=${{ secrets.MAPBOX_SDK_REPO_TOKEN }}" >> local.properties

Expand All @@ -46,18 +55,38 @@ jobs:
- name: Clean & Build project skipping tests
run: ./gradlew clean build -x test --stacktrace

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run Instrumented Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: true
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedDebug --stacktrace --info
script: ./gradlew connectedDebug --stacktrace

- name: Run jacocoTestReport for each module
run: ./gradlew jacocoTestReport --stacktrace --info
run: ./gradlew jacocoTestReport --stacktrace

- name: Merge jacoco reports from all modules
run: ./gradlew jacocoFullReport --stacktrace
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ jobs:
access_token: ${{ github.token }}

- name: Checkout 🛎️
uses: actions/checkout@v2
with:
fetch-depth: 2
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v1
with:
distribution: temurin
java-version: 17

- name: Create local.properties file
Expand All @@ -58,7 +57,7 @@ jobs:
- name: Run Instrumented Tests manually
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 22
api-level: 34
script: ./gradlew :library:connectedDebug --stacktrace --info

- name: Run unit tests with Gradle
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ jobs:
- name: Cancel previous workflow runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
access_token: ${{ github.token }}

- name: Checkout 🛎️
uses: actions/checkout@v2
with:
fetch-depth: 2
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v1
with:
distribution: temurin
java-version: 17

- name: Create local.properties file
Expand All @@ -58,7 +57,7 @@ jobs:
- name: Run Instrumented Tests manually
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 22
api-level: 34
script: ./gradlew :utils:connectedDebug --stacktrace

- name: Generate & upload utils snapshot artifact AAR (Android Archive) file to Sonatype
Expand Down

0 comments on commit 01e91a9

Please sign in to comment.