Prevent ConnectivityManager.TooManyRequestsException #478
This file contains hidden or 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: Run tests and publish snapshot | |
on: | |
push: | |
branches: [ trunk ] | |
pull_request: | |
jobs: | |
unit-tests: | |
name: Run checks against JVM targets | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/actions/setup-gradle@v4 | |
- name: Run unit tests and friends | |
run: ./gradlew testDebugUnitTest desktopTest metalavaCheckCompatibilityRelease | |
- name: Run paparazzi screenshot tests | |
run: ./gradlew verifyPaparazziDebug | |
- name: (Fail-only) Upload paparazzi test reports | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-failures | |
path: | | |
**/build/reports/tests/*/ | |
**/out/failures/ | |
paparazzi/paparazzi-gradle-plugin/src/test/projects/**/build/reports/paparazzi/images/ | |
- uses: oNaiPs/secrets-to-env-action@v1 | |
with: | |
secrets: ${{ toJSON(secrets) }} | |
- name: Run instrumented screenshot tests | |
env: | |
# https://docs.emulator.wtf/github/tokenless | |
EW_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew testDebugWithEmulatorWtf | |
- name: (Fail-only) Bundle instrumented test reports | |
if: failure() | |
run: find . -type d '(' -name 'reports' -o -name 'test-results' ')' | zip -@ -r instrumentation-test-build-reports.zip | |
- name: (Fail-only) Upload instrumented test reports | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: instrumentation-test-report | |
path: instrumentation-test-build-reports.zip | |
screenshot-tests: | |
name: Compile non-JVM sources | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/actions/setup-gradle@v4 | |
- name: Compile the iOS sources | |
run: ./gradlew compileKotlinIosArm64 | |
- name: Compile the desktop sources | |
run: ./gradlew compileKotlinDesktop | |
- name: Compile the web sources | |
run: ./gradlew compileKotlinWasmJs compileKotlinJs | |
deploy-snapshot: | |
name: Deploy snapshot | |
runs-on: ubuntu-latest | |
if: github.repository == 'saket/telephoto' && github.ref == 'refs/heads/trunk' | |
needs: [unit-tests, screenshot-tests] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2.4.2 | |
- name: Ensure snapshot version | |
run: ./gradlew throwIfVersionIsNotSnapshot | |
- name: Publish snapshot | |
run: ./gradlew clean publish --no-daemon --no-parallel --no-configuration-cache --stacktrace | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} |