ci: cache avd #327
Workflow file for this run
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: Assemble project | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build library | |
run: ./gradlew :parsely:assembleDebug | |
- name: Build example app | |
run: ./gradlew :example:assembleDebug | |
- name: Android Lint | |
run: ./gradlew lintDebug | |
- name: Android Unit Tests | |
run: ./gradlew :parsely:testDebugUnitTest | |
- name: Generate XML coverage report | |
run: ./gradlew :parsely:koverXmlReportDebug | |
- uses: codecov/codecov-action@v3 | |
with: | |
files: parsely/build/reports/kover/reportDebug.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Validate Maven publication | |
run: ./gradlew :parsely:publishReleasePublicationToMavenLocal | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
- name: Publish build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: ~/.m2/repository/com/parsely/parsely/* | |
functional-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- 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 | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd | |
- name: Functional Tests | |
uses: reactivecircus/android-emulator-runner@v2.29.0 | |
with: | |
working-directory: . | |
api-level: 31 | |
profile: Nexus 6 | |
arch: x86_64 | |
force-avd-creation: false | |
avd-name: macOS-avd-x86_64-31 | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: ./gradlew :parsely:connectedDebugAndroidTest | |
- name: Publish build artifacts | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: artifact | |
path: | | |
./parsely/build/reports/* | |
./parsely/build/outputs/androidTest-results |