feat: add autotrack switch #26
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: PRE_RELEASE | |
on: | |
pull_request: | |
types: [ labeled ] | |
jobs: | |
build: | |
if: ${{ github.event.label.name == 'pre release' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete unnecessary tools 🔧 | |
uses: jlumbroso/[email protected] | |
with: | |
android: false # Don't remove Android tools | |
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY" | |
dotnet: true # rm -rf /usr/share/dotnet | |
haskell: true # rm -rf /opt/ghc... | |
swap-storage: true # rm -f /mnt/swapfile (4GiB) | |
docker-images: false # Takes 16s, enable if needed in the future | |
large-packages: false # includes google-cloud-sdk and it's slow | |
- name: Enable KVM group perms | |
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 | |
ls /dev/kvm | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Pull & update submodules recursively | |
run: | | |
git submodule update --init --recursive | |
git submodule update --recursive --remote | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Before script | |
run: | | |
chmod +x gradlew | |
chmod +x gradle/publishAllToMavenLocal.sh | |
chmod +x gradle/preRelease.sh | |
- name: Run Gradle command | |
run: | | |
bash ./gradlew spotlessCheck | |
bash ./gradle/publishAllToMavenLocal.sh | |
bash ./gradle/preRelease.sh | |
- name: Run demo ui tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
target: default | |
ram-size: 4096M | |
arch: x86_64 | |
disable-animations: true | |
disk-size: 6000M | |
heap-size: 600M | |
working-directory: ./demo | |
script: ./gradlew :app:connectedAndroidTest --stacktrace | |
- name: Run sdk unit tests | |
run: | | |
bash ./gradlew jacocoTestReport --stacktrace | |
bash ./gradlew :jacocoAllReport | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew sonarqube | |
continue-on-error: true | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./build/reports/jacoco/jacocoAllReport/jacocoAllReport.xml |