Skip to content

Commit

Permalink
Split build workflow into multiple jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
LachlanMcKee committed Jul 10, 2023
1 parent 22d2bcc commit 439d577
Showing 1 changed file with 79 additions and 8 deletions.
87 changes: 79 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
run: >
./gradlew
build
projectHealth
mergeLintSarif
mergeDetektSarif
:plugins:buildPlugins
--continue
- name: Check publication setup
Expand All @@ -53,11 +50,60 @@ jobs:
-Psigning.password=${{ secrets.SIGNING_PASSWORD }}
-Psonatype.username=${{ secrets.SONATYPE_USERNAME }}
-Psonatype.password=${{ secrets.SONATYPE_PASSWORD }}
- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: |
**/build/reports/
!**/build/reports/dependency-analysis/
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ env.MAIN_BRANCH != 'true' }}
- name: Lint
run: >
./gradlew mergeLintSarif --continue
- uses: github/codeql-action/upload-sarif@v2
if: success() || failure()
with:
sarif_file: build/lint-merged.sarif
category: lint
- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: lint-reports
path: |
**/build/reports/
!**/build/reports/dependency-analysis/
code-health:
name: Code health
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ env.MAIN_BRANCH != 'true' }}
- name: Detekt
run: ./gradlew mergeDetektSarif --continue
- uses: github/codeql-action/upload-sarif@v2
if: success() || failure()
with:
Expand All @@ -67,10 +113,9 @@ jobs:
if: failure()
uses: actions/upload-artifact@v3
with:
name: reports
name: detekt-merged.sarif
path: |
**/build/reports/
!**/build/reports/dependency-analysis/
build/detekt-merged.sarif
instrumentation-tests:
name: Instrumentation tests
Expand All @@ -89,25 +134,51 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Instrumentation tests
# Flags from https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml
run: >
adb logcat > logcat.out &
./gradlew cleanManagedDevices --unused-only &&
./gradlew pixel2api30DebugAndroidTest
-Dorg.gradle.workers.max=1
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
- name: Upload failed instrumentation artifacts
if: failure()
uses: actions/upload-artifact@v2
with:
name: instrumentation-failures
path: |
**/build/reports
logcat.out
screenshot-tests:
name: Screenshot tests
runs-on: macOS-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ env.MAIN_BRANCH != 'true' }}
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Screenshot tests
# Flags from https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml
run: >
./gradlew cleanManagedDevices --unused-only && ./gradlew screenshotTestsCompareBaseline
-Dorg.gradle.workers.max=1
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
- name: Upload failed instrumentation artifacts
- name: Upload failed screenshot artifacts
if: failure()
uses: actions/upload-artifact@v2
with:
name: instrumentation-failures
name: screenshot-failures
path: |
**/build/reports
logcat.out
Expand Down

0 comments on commit 439d577

Please sign in to comment.