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

Test differnt versions of AGP #76

Merged
merged 2 commits into from
Jan 6, 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
46 changes: 46 additions & 0 deletions .github/workflows/test-agp-variants.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Test Plugin with different AGP'

on:
pull_request:
push:
branches:
- main

jobs:
localPluginTestDifferentAGP:
runs-on: ubuntu-latest
strategy:
matrix:
# We are aiming to test 5 different AGP versions
# 1. The current stable one
# 2. The latest three releases
# 3. The next after the current stable (alpha or beta doesn't matter)
# The test cases needs to be updated regularly here
# https://maven.google.com/web/index.html?q=gradle#com.android.tools.build:gradle
agp_version: [ '7.4.1', '8.0.2', '8.1.4', '8.2.1', '8.3.0-beta01' ]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-caches-v0-${{ hashFiles('build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.tml') }}

- name: Change AGP version
run: |
export VERSION=${{ matrix.agp_version }}
sed -i "s/com\.android\.tools\.build:gradle:[0-9]\+\.[0-9]\+\.[0-9]\+/com.android.tools.build:gradle:$VERSION/" ./gradle/libs.versions.toml
cat gradle/libs.versions.toml

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- name: Run 'normal' tests
run: ./gradlew test --tests 'SentryProguardGradlePluginTest'
4 changes: 2 additions & 2 deletions .github/workflows/test-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-caches-v0-${{ hashFiles('build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
key: gradle-caches-v0-${{ hashFiles('build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.tml') }}

- name: Setup JDK 17
uses: actions/setup-java@v4
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-caches-v0-${{ hashFiles('build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
key: gradle-caches-v0-${{ hashFiles('build.gradle.kts', 'settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.tml') }}

- name: Setup JDK 17
uses: actions/setup-java@v4
Expand Down