Build and Test on 3a295a101912b04dc5d45ec198fea4af0e40240d #11
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-and-Test | |
run-name: Build and Test on ${{ github.sha }} | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'app/**' | |
- 'settings.gradle' | |
- 'build.gradle' | |
- '.github/workflows/build-test.yml' | |
pull_request: | |
branches: | |
- master | |
workflow_call: null | |
jobs: | |
Style-Check: | |
uses: ./.github/workflows/check-style.yml | |
with: | |
trigger: "${{ github.event_name }}" | |
permissions: | |
contents: write | |
pull-requests: write | |
Build-and-Test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
needs: Style-Check | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '19' | |
distribution: 'temurin' | |
- name: Create KeyStore and gradle.properties | |
run: | | |
storePass=dummyPassword | |
keyAlias=test | |
keyPass=dummyPassword | |
keytool -genkey -keystore keyStore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias "$keyAlias" \ | |
-dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" -storepass "$storePass" -keypass "$keyPass" | |
mkdir -p ~/.gradle | |
echo "RELEASE_STORE_FILE=../keyStore.jks" >~/.gradle/gradle.properties | |
echo "RELEASE_STORE_PASSWORD=$storePass" >>~/.gradle/gradle.properties | |
echo "RELEASE_KEY_ALIAS=$keyAlias" >>~/.gradle/gradle.properties | |
echo "RELEASE_KEY_PASSWORD=$keyPass" >>~/.gradle/gradle.properties | |
- name: Build | |
run: | | |
chmod +x gradlew | |
./gradlew assembleLatest | |
- 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: Test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 28 | |
script: ./gradlew connectedLatestDebugAndroidTest |