Merge pull request #116 from Parsely/support_site_id_per_request #379
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: Validate binary compatibility | |
run: ./gradlew apiCheck | |
- 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: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
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-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
disk-size: 4096M | |
script: echo "Generated AVD snapshot for caching." | |
- name: Functional Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
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 | |
disk-size: 4096M | |
script: adb uninstall "com.parsely.parselyandroid.test"; ./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 |