Skip to content

Add write permissions to run-test #23

Add write permissions to run-test

Add write permissions to run-test #23

Workflow file for this run

name: Run tests
env:
# The name of the main module repository
main_project_module: app
# The name in the Play Store
playstore_name: Soundscape
on:
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
environment: development
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Decode Google services
env:
ENCODED_STRING: ${{ secrets.GOOGLE_SERVICES }}
GOOGLE_SERVICES_PATH: ${{ secrets.GOOGLE_SERVICES_PATH }}
run: |
echo $ENCODED_STRING > google-services-b64.txt
base64 -d google-services-b64.txt > ${{ env.main_project_module }}/$GOOGLE_SERVICES_PATH
- name: Run lint over the repo
run: ./gradlew lint
- name: Run tests
run: ./gradlew test
- name: Build debug version
run: ./gradlew assembleDebug
- 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: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: default
arch: x86_64
script: ./gradlew connectedCheck