Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GMD tests #867

Merged
merged 22 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ jobs:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
cache-read-only: true # gradle user home cache is generated by test jobs

- name: Use incremental build cache
uses: actions/cache/restore@v4
with:
key: incremental-build-tests
restore-keys: incremental-build-tests # restore cache from main branch
path: app/build

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
50 changes: 21 additions & 29 deletions .github/workflows/test-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,26 @@ concurrency:
group: test-dev-${{ github.ref }}
cancel-in-progress: true

env:
is_main_branch: ${{ github.ref == 'refs/heads/main-ose' }}

jobs:
compile:
name: Compile and cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v3 # creates build cache when on main branch
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
gradle-home-cache-cleanup: true # clean up unused files
gradle-home-cache-excludes: |
- caches/transforms-* # transforms are very big
- run: ./gradlew --build-cache --configuration-cache --configuration-cache-problems=warn --no-daemon app:assembleDebug

test:
needs: compile
name: Tests without emulator
runs-on: ubuntu-latest
steps:
Expand All @@ -24,20 +39,14 @@ jobs:
- uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
cache-read-only: true # gradle user home cache is generated by test_on_emulator

- name: Use incremental build cache
uses: actions/cache/restore@v4
with:
key: incremental-build-tests
restore-keys: incremental-build-tests # restore cache from main branch
path: app/build
cache-read-only: true

- name: Run lint and unit tests
run: ./gradlew --build-cache --configuration-cache --configuration-cache-problems=warn --no-daemon app:check

# generates the build caches because it uses more gradle dependencies
test_on_emulator:
needs: compile
name: Tests with emulator
runs-on: ubuntu-latest
steps:
Expand All @@ -49,17 +58,7 @@ jobs:
- uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
gradle-home-cache-cleanup: true # avoid ever-growing gradle user home cache

- name: Use incremental build cache
if: ${{ !env.is_main_branch }}
uses: actions/cache/restore@v4
with:
key: incremental-build-tests
restore-keys: incremental-build-tests # restore cache from main branch
path: |
.gradle/configuration-cache
app/build
cache-read-only: true

- name: Enable KVM group perms
run: |
Expand All @@ -75,10 +74,3 @@ jobs:

- name: Run device tests
run: ./gradlew --build-cache --configuration-cache --configuration-cache-problems=warn --no-daemon app:virtualCheck

- name: Create incremental build cache
if: ${{ env.is_main_branch }}
uses: actions/cache/save@v4
with:
key: incremental-build-tests-${{ github.run_id }}
path: app/build
Empty file added run-ci
Empty file.
Loading