feat: Initial implementation of shared elements #93
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: Build & Test | |
env: | |
# The name of the main module repository | |
main_project_module: app | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Set Repository Name As Env Variable | |
- name: Set repository name as env variable | |
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
- name: Write value to Properties-file | |
env: | |
MASTODON_USERNAME: ${{ secrets.MASTODON_USERNAME }} | |
MASTODON_PASSWORD: ${{ secrets.MASTODON_PASSWORD }} | |
MASTODON_SITE: ${{ secrets.MASTODON_SITE }} | |
run: | | |
echo "MASTODON_USERNAME=$MASTODON_USERNAME" >> ./app/benchmark/mastodon.properties | |
echo "MASTODON_PASSWORD=$MASTODON_PASSWORD" >> ./app/benchmark/mastodon.properties | |
echo "MASTODON_SITE=$MASTODON_SITE" >> ./app/benchmark/mastodon.properties | |
- name: Set Up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
cache: "gradle" | |
# Required for Setting Up Benchmarks | |
# - name: Enable KVM | |
# run: | | |
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
# sudo udevadm control --reload-rules | |
# sudo udevadm trigger --name-match=kvm | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Add google-services.json | |
run: mv app/google-services-sample.json app/google-services.json | |
# Run Build Project | |
- name: Build gradle project | |
run: ./gradlew app:assemble | |
# Run Tests Build | |
- name: Run gradle tests | |
run: ./gradlew app:testGmsDebugUnitTest | |
# Setup benchmarks | |
# https://github.com/ReactiveCircus/android-emulator-runner/issues/161#issuecomment-1248757074 | |
# - name: Run benchmarks | |
# env: | |
# MASTODON_USERNAME: ${{ secrets.MASTODON_USERNAME }} | |
# MASTODON_PASSWORD: ${{ secrets.MASTODON_PASSWORD }} | |
# MASTODON_SITE: ${{ secrets.MASTODON_SITE }} | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# with: | |
# api-level: 34 | |
# # restart adb to fix broken emulator | |
# script: adb kill-server && adb start-server && ./gradlew app:benchmark:connectedBenchmarkAndroidTest |