Skip to content

Commit

Permalink
Merge pull request #2724 from quran/clean_up_actions
Browse files Browse the repository at this point in the history
Clean up GitHub Actions
  • Loading branch information
ahmedre authored Jun 2, 2024
2 parents 57c285f + 2fc3b77 commit 1e191d5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 75 deletions.
94 changes: 21 additions & 73 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android Pull Request
name: Pull Request
on:
pull_request:
branches:
Expand All @@ -10,7 +10,7 @@ concurrency:

jobs:
build:
name: Build
name: Validate PR
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
Expand All @@ -28,45 +28,6 @@ jobs:
- name: Build debug APK
run: ./gradlew assembleMadaniDebug

- name: Download Previous Debug APK
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: post_merge.yml
name: latest-apk

- name: Run Apk Diff
run: |
gh release download -p '*.jar' -R jakewharton/diffuse 0.1.0
java -jar diffuse-0.1.0-binary.jar diff app-madani-debug.apk app/build/outputs/apk/madani/debug/app-madani-debug.apk > apk_differences.txt
{ echo "\`\`\`"; head -n 17 apk_differences.txt; echo "\`\`\`"; echo; } >> apk_differences_summary.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Apk Diff Results
uses: actions/upload-artifact@v4
if: success()
with:
name: apk_differences
path: apk_differences_summary.txt

lint:
needs: [build]
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Run lint
run: ./gradlew lintMadaniDebug

Expand All @@ -77,23 +38,6 @@ jobs:
name: lint_report
path: app/build/reports/lint-results-madaniDebug.html

test:
needs: [build]
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Run SqlDelight migration tests
run: ./gradlew verifySqlDelightMigration

Expand All @@ -107,22 +51,27 @@ jobs:
name: unit_test_report
path: app/build/reports/tests/testMadaniDebugUnitTest/

diffs:
needs: [lint, test]
name: Dependency Diff
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
- name: Download Previous Debug APK
uses: dawidd6/action-download-artifact@v3
with:
distribution: zulu
java-version: 17
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: post_merge.yml
name: latest-apk

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Run Apk Diff
run: |
gh release download -p '*.jar' -R jakewharton/diffuse 0.1.0
java -jar diffuse-0.1.0-binary.jar diff app-madani-debug.apk app/build/outputs/apk/madani/debug/app-madani-debug.apk > apk_differences.txt
{ echo "\`\`\`"; head -n 17 apk_differences.txt; echo "\`\`\`"; echo; } >> apk_differences_summary.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Apk Diff Results
uses: actions/upload-artifact@v4
if: success()
with:
name: apk_differences
path: apk_differences_summary.txt

- name: Get dependencies list
run: ./gradlew :app:dependencies --configuration madaniReleaseRuntimeClasspath > current_dependencies.txt
Expand Down Expand Up @@ -159,6 +108,5 @@ jobs:
name: pr
path: pr.txt


env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx8G -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8"
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android Merge Queue
name: Merge Queue
on:
merge_group:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Comment on the pull request

on:
workflow_run:
workflows: ["Android Pull Request"]
workflows: ["Pull Request"]
types:
- completed

Expand Down

0 comments on commit 1e191d5

Please sign in to comment.