diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a25d987490..4c422b5933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,9 +29,6 @@ jobs: run: > ./gradlew build - projectHealth - mergeLintSarif - mergeDetektSarif :plugins:buildPlugins --continue - name: Check publication setup @@ -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: @@ -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 @@ -89,6 +134,7 @@ 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 && @@ -96,6 +142,31 @@ jobs: -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: > @@ -103,11 +174,11 @@ jobs: -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