fix build #165
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ main ] | |
# Build on all pull requests, regardless of target. | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '8' | |
- name: Build with Gradle | |
run: ./gradlew build --stacktrace | |
instrumentation-tests: | |
name: Instrumentation tests | |
runs-on: macos-latest | |
timeout-minutes: 30 | |
strategy: | |
# Allow tests to continue on other devices if they fail on one device. | |
fail-fast: false | |
matrix: | |
arch: [x86_64] | |
api-level: | |
- 21 | |
- 23 | |
- 26 | |
- 29 | |
- 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
- name: Instrumentation Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: google_apis | |
arch: ${{ matrix.arch }} | |
script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace | |
- name: Upload results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.api-level }}-${{ matrix.arch }}-instrumentation-test-results | |
path: ./**/build/reports/androidTests/connected/** | |
snapshot-deployment: | |
if: github.repository == 'square/papa' && github.event_name == 'push' | |
needs: [ build ] #, instrumentation-tests ] UI tests setup is currently broken. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: 'zulu' | |
- uses: gradle/gradle-build-action@v2 | |
- name: Deploy snapshot | |
run: ./gradlew publish | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
- name: Cleanup secrets | |
if: always() | |
run: rm -rf ~/.gradle/gradle.properties |