Skip to content

Update all dependencies #150

Update all dependencies

Update all dependencies #150

name: Build and Test Adaptive Jetstream
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# screenshot reference files to the repository.
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: ./AdaptiveJetStream
- name: Build Debug APK
run: ./gradlew assembleDebug
working-directory: ./AdaptiveJetStream
- name: Run Unit Tests
run: ./gradlew testDebugUnitTest
working-directory: ./AdaptiveJetStream
- name: Run all local screenshot tests
id: screenshotsverify
continue-on-error: true
run: ./gradlew validateDebugScreenshotTest
working-directory: ./AdaptiveJetStream
- name: Prevent pushing new screenshots if this is a fork
id: checkfork_screenshots
continue-on-error: false
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "::error::Screenshot tests failed, please create a PR in your fork first."
echo "Your fork's CI will take screenshots for your fork."
exit 1
working-directory: ./AdaptiveJetStream
# Runs if previous job failed
- name: Generate new screenshots if verification failed and it's a PR
id: screenshotsrecord
if: steps.screenshotsverify.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./gradlew updateDebugScreenshotTest
working-directory: ./AdaptiveJetStream
- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v7
if: steps.screenshotsrecord.outcome == 'success'
with:
file_pattern: 'AdaptiveJetStream/jetstream/src/screenshotTestDebug/reference/**/*.png'
commit_message: "🤖 Updates screenshots"