Add custom sponsorship URLs to FUNDING.yml #160
This file contains hidden or 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_test | |
| on: | |
| workflow_dispatch: | |
| push: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| ndk_version: 28.1.13356709 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: install ninja | |
| run: sudo apt-get install -y ninja-build | |
| - name: setup java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: setup python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: install python dependencies | |
| run: pip install conan | |
| - name: install ndk | |
| run: yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.ndk_version }}" | |
| - name: conan remote | |
| run: | | |
| conan remote remove "*" | |
| conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan | |
| conan remote add conancenter https://center2.conan.io | |
| - name: conan profile | |
| run: conan profile detect | |
| - name: Gradle cache | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: gradle | |
| run: ./gradlew assembleDebug lintProDebug lintLiteDebug --stacktrace | |
| - name: conan cache size | |
| run: du -h -d1 ~/.conan2/p | |
| - name: conan login | |
| run: conan remote login odr admin --password '${{ secrets.ARTIFACTORY }}' | |
| - name: conan upload | |
| run: conan upload "*" --check --confirm --remote odr | |
| - name: Artifact APKs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: APKs | |
| path: app/build/outputs/apk/**/*.apk | |
| if-no-files-found: error | |
| compression-level: 0 | |
| - name: Artifact lint results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-report | |
| path: app/build/reports/lint-results-*.html | |
| if-no-files-found: error | |
| test: | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # broken for unknown reasons. needs some offline debugging | |
| # https://github.com/opendocument-app/OpenDocument.droid/issues/390 | |
| # - { arch: x86_64, api-level: 23 } | |
| - { arch: x86_64, api-level: 29 } | |
| - { arch: x86_64, api-level: 30 } | |
| - { arch: x86_64, api-level: 32 } | |
| - { arch: x86_64, api-level: 34 } | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: install ninja | |
| run: sudo apt-get install -y ninja-build | |
| - name: java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: install fastlane | |
| run: bundle install | |
| - name: setup python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: install python dependencies | |
| run: pip install conan | |
| - name: install ndk | |
| run: yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.ndk_version }}" | |
| - name: conan remote | |
| run: | | |
| conan remote remove "*" | |
| conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan | |
| conan remote add conancenter https://center2.conan.io | |
| - name: conan profile | |
| run: conan profile detect | |
| - name: Gradle cache | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-${{ matrix.api-level }}-v3 | |
| - 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: Create AVD and generate snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: ${{ matrix.arch }} | |
| target: google_apis | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: false | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: Run tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: ${{ matrix.arch }} | |
| target: google_apis | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: | | |
| # Clear logcat before tests | |
| adb logcat -c | |
| # Run tests | |
| ./gradlew connectedCheck | |
| # Dump logcat after tests | |
| adb logcat -d > logcat.txt | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.api-level }} | |
| path: | | |
| app/build/reports/androidTests/ | |
| app/build/outputs/androidTest-results/ | |
| if-no-files-found: warn | |
| - name: Upload test logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-logs-${{ matrix.api-level }} | |
| path: | | |
| app/build/outputs/logs/ | |
| app/build/test-results/ | |
| if-no-files-found: warn | |
| - name: Upload emulator logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: emulator-logs-${{ matrix.api-level }} | |
| path: | | |
| ~/.android/avd/*.avd/config.ini | |
| ~/.android/avd/*.avd/*.log | |
| logcat.txt | |
| if-no-files-found: warn |