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

Improve PR workflow #235

Merged
merged 5 commits into from
Nov 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
33 changes: 23 additions & 10 deletions .github/workflows/PR-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,36 @@ on:
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
flavor: [Aosp, Google]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Cache gradle
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Check detekt
run: ./gradlew detekt

- name: Check lint
run: ./gradlew lint
- name: Run tests on ${{ matrix.flavor }} flavour
run: ./gradlew test${{ matrix.flavor }}DebugUnitTest
- name: Assemble ${{ matrix.flavor }} debug build
run: ./gradlew assemble${{ matrix.flavor }}Debug

- name: Run tests on AOSP flavour
run: ./gradlew testAospDebugUnitTest

- name: Compile AOSP debug build to verify no-compilation errors
run: ./gradlew compileAospDebugKotlin

- name: Compile Google debug build to verify no-compilation errors
run: ./gradlew compileGoogleDebugKotlin
9 changes: 8 additions & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Cache gradle
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Unpack secrets
run: |
Expand Down