Skip to content

Commit

Permalink
Tweak build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-tran committed Jan 8, 2025
1 parent a087acd commit 9352563
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 40 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Prepare env
id: prepare_env
run: |
Expand Down Expand Up @@ -82,8 +79,14 @@ jobs:
- name: Set up gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Build Benchmark app and run unit tests
run: ./gradlew spotlessCheck assembleDevBenchmark testDevBenchmarkUnitTest testReleaseUnitTest -Pandroid.signingConfig=debug --stacktrace
- name: Check code format
run: ./gradlew spotlessCheck

- name: Build app
run: ./gradlew assembleDevBenchmark -Pandroid.signingConfig=debug

- name: Run unit tests
run: ./gradlew testReleaseUnitTest testDevBenchmarkUnitTest

- name: Sign APK
uses: r0adkll/sign-android-release@349ebdef58775b1e0d8099458af0816dc79b6407 # v1
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Setup Android SDK
run: |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3"
Expand Down Expand Up @@ -68,13 +65,19 @@ jobs:
- name: Set up gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Build app and run unit tests
run: ./gradlew spotlessCheck assembleStandardPreview testStandardPreviewUnitTest testReleaseUnitTest --stacktrace
- name: Check code format
run: ./gradlew spotlessCheck

- name: Build app
run: ./gradlew assembleStandardRelease

- name: Run unit tests
run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest

- name: Sign APK
uses: r0adkll/sign-android-release@349ebdef58775b1e0d8099458af0816dc79b6407 # v1
with:
releaseDirectory: app/build/outputs/apk/standard/preview
releaseDirectory: app/build/outputs/apk/standard/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
Expand All @@ -90,7 +93,7 @@ jobs:
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
echo "COMMIT_COUNT=$commit_count"
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
mv app/build/outputs/apk/standard/preview/app-standard-universal-preview-unsigned-signed.apk Komikku-$version_tag-r$commit_count.apk
mv app/build/outputs/apk/standard/release/app-standard-universal-release-unsigned-signed.apk Komikku-$version_tag-r$commit_count.apk
- name: Upload APK
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/build_dispatch_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Prepare build
id: prepare_build
run: |
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/build_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Get previous release
id: last_release
uses: InsonusK/get-latest-release@7a9ff16c8c6b7ead5d71c0f1cc61f2703170eade # v1.1.0
Expand Down Expand Up @@ -151,8 +148,14 @@ jobs:
- name: Set up gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Build Preview app and run unit tests
run: ./gradlew spotlessCheck assembleStandardPreview testStandardPreviewUnitTest testReleaseUnitTest --stacktrace
- name: Check code format
run: ./gradlew spotlessCheck

- name: Build app
run: ./gradlew assembleStandardPreview

- name: Run unit tests
run: ./gradlew testReleaseUnitTest testStandardPreviewUnitTest

- name: Upload artifacts
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Dependency Review
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0

Expand Down Expand Up @@ -71,13 +68,19 @@ jobs:
- name: Set up gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Build app and run unit tests
run: ./gradlew spotlessCheck assembleStandardPreview testStandardPreviewUnitTest testReleaseUnitTest --stacktrace
- name: Check code format
run: ./gradlew spotlessCheck

- name: Build app
run: ./gradlew assembleStandardRelease

- name: Run unit tests
run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest

- name: Sign APK
uses: r0adkll/sign-android-release@349ebdef58775b1e0d8099458af0816dc79b6407 # v1
with:
releaseDirectory: app/build/outputs/apk/standard/preview
releaseDirectory: app/build/outputs/apk/standard/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
Expand All @@ -94,7 +97,7 @@ jobs:
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
echo "COMMIT_COUNT=$commit_count"
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
mv app/build/outputs/apk/standard/preview/app-standard-universal-preview-unsigned-signed.apk Komikku-$version_tag-r$commit_count.apk
mv app/build/outputs/apk/standard/release/app-standard-universal-release-unsigned-signed.apk Komikku-$version_tag-r$commit_count.apk
- name: Upload APK
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/build_pull_request_forked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Dependency Review
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0

Expand All @@ -57,8 +54,14 @@ jobs:
- name: Set up gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Build app and run unit tests
run: ./gradlew spotlessCheck assembleDevDebug testDevDebugUnitTest testDebugUnitTest --stacktrace
- name: Check code format
run: ./gradlew spotlessCheck

- name: Build app
run: ./gradlew assembleDevDebug

- name: Run unit tests
run: ./gradlew testDebugUnitTest testDevDebugUnitTest

- name: Rename apk
id: current_commit
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Get previous release
id: last_release
uses: InsonusK/get-latest-release@7a9ff16c8c6b7ead5d71c0f1cc61f2703170eade # v1.1.0
Expand Down Expand Up @@ -97,9 +94,6 @@ jobs:
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Setup Android SDK
run: |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3"
Expand Down Expand Up @@ -127,8 +121,14 @@ jobs:
- name: Set up gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4

- name: Build app and run unit tests
run: ./gradlew spotlessCheck assembleStandardRelease testStandardReleaseUnitTest testReleaseUnitTest --stacktrace
- name: Check code format
run: ./gradlew spotlessCheck

- name: Build app
run: ./gradlew assembleStandardRelease

- name: Run unit tests
run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest

- name: Upload artifacts
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
Expand Down

0 comments on commit 9352563

Please sign in to comment.