Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Fix Integration tests (#3395)
Browse files Browse the repository at this point in the history
* Attempt to fix integration tests 1

* Update steps name to trigger the workflow

* Optimize workflow

* Fix workflow

* Downgrade Emulator API level to 29

* Upgrade back to api-level 34

* Update to `gradle/actions/setup-gradle@v4`

* Make all workflows use the standard Gradle setup
  • Loading branch information
ILIYANGERMANOV authored Aug 4, 2024
1 parent d3e475a commit b85b1c3
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 116 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Build Demo APK
run: ./gradlew assembleDemo
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci_actions_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Test the CI actions "base"
run: ./gradlew :ci-actions:base:test
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/compose_stability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Build Compose compiler report (Jetpack Compose)
run: ./gradlew assembleDemo -PcomposeCompilerReports=true
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Detekt
run: ./gradlew detekt
Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,47 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Enable KVM (emulator optimization)
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: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
~/.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/[email protected]
with:
api-level: 34
target: google_apis
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: Build Ivy Wallet's code
run: |
./gradlew :shared:data:core:assembleDebug :shared:data:core:assembleAndroidTest
./gradlew :shared:domain:assembleDebug :shared:domain:assembleAndroidTest
- name: Enable KVM (emulator optimization)
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: Run android tests on Emulator
uses: reactivecircus/android-emulator-runner@v2
- name: Run androidTest on emulator
uses: reactivecircus/[email protected]
with:
api-level: 29
api-level: 34
target: google_apis
arch: x86_64
script: |
./gradlew :shared:data:core:connectedDebugAndroidTest
./gradlew :shared:domain:connectedDebugAndroidTest
13 changes: 2 additions & 11 deletions .github/workflows/internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,8 @@ jobs:
run: bundle install
#----------------------------------------------------

# Optimization
- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
#---------------------------------------------------
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

# Decode Secrets for production build
- name: Create JKS for prod signing
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/issue_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Execute the "Issue Assign" automation
run: ./gradlew :ci-actions:issue-assign:run --args='issueNumber=${{ github.event.issue.number }} gitHubPAT=${{ secrets.IVYWALLET_BOT_GITHUB_PAT_2 }}'
11 changes: 2 additions & 9 deletions .github/workflows/issue_created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Execute the "Issue Created" automation
run: ./gradlew :ci-actions:issue-create-comment:run --args='issueNumber=${{ github.event.issue.number }} gitHubPAT=${{ secrets.IVYWALLET_BOT_GITHUB_PAT_2 }}'
11 changes: 2 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Lint (release)
run: ./gradlew lintRelease
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/paparazzi_screenshot_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Run Paparazzi screenshot tests
run: ./gradlew verifyPaparazziDebug
11 changes: 2 additions & 9 deletions .github/workflows/pr_description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Extract PR description (base 64)
id: extract_description
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ jobs:
distribution: 'adopt'
java-version: '18'

- name: Enable Gradle Wrapper caching (optimization)
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Run unit tests
run: ./gradlew testDebugUnitTest
Expand Down

0 comments on commit b85b1c3

Please sign in to comment.