This repository was archived by the owner on Jul 15, 2026. It is now read-only.
Migrate from python-for-android to Chaquopy #27
Workflow file for this run
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 and Test | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| pre_job: | |
| name: Path match check | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@v5.3.1 | |
| with: | |
| github_token: ${{ github.token }} | |
| paths_ignore: '["**.po", "**.json"]' | |
| download_tar: | |
| name: Download Kolibri tar | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tar-file-name: ${{ steps.get_tar.outputs.tar-file-name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get latest Kolibri release URL | |
| id: get_release | |
| uses: actions/github-script@v8 | |
| with: | |
| result-encoding: string | |
| script: | | |
| const { data: releases } = await github.rest.repos.listReleases({ | |
| owner: 'learningequality', | |
| repo: 'kolibri', | |
| per_page: 1, | |
| page: 1, | |
| }); | |
| if (!releases.length) throw new Error('No releases found for kolibri'); | |
| const latestRelease = releases[0]; | |
| const tarAsset = latestRelease.assets.find(asset => asset.name.endsWith('.tar.gz')); | |
| if (!tarAsset) throw new Error('No .tar.gz asset in latest release'); | |
| return tarAsset.browser_download_url; | |
| - name: Download Kolibri tar | |
| id: get_tar | |
| env: | |
| TAR_URL: ${{ steps.get_release.outputs.result }} | |
| run: | | |
| make get-tar tar="$TAR_URL" | |
| echo "tar-file-name=$(ls tar/*.tar.gz | head -1 | xargs basename)" >> $GITHUB_OUTPUT | |
| - name: Upload tar as artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ steps.get_tar.outputs.tar-file-name }} | |
| path: tar/${{ steps.get_tar.outputs.tar-file-name }} | |
| build_apk: | |
| name: Build Debug APK | |
| needs: [pre_job, download_tar] | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| uses: ./.github/workflows/build_apk.yml | |
| with: | |
| tar-file-name: ${{ needs.download_tar.outputs.tar-file-name }} | |
| tests: | |
| name: Unit tests | |
| needs: [pre_job, download_tar] | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| - name: Download Kolibri tar | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ${{ needs.download_tar.outputs.tar-file-name }} | |
| path: tar | |
| - name: Run unit tests | |
| run: ./gradlew test | |
| smoke_test: | |
| name: Smoke test (API ${{ matrix.api-level }}) | |
| needs: [pre_job, build_apk] | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| api-level: [24, 30, 35] | |
| include: | |
| - api-level: 24 | |
| target: default | |
| - api-level: 30 | |
| target: google_apis | |
| - api-level: 35 | |
| target: google_apis | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Install Maestro CLI | |
| run: make maestro-install | |
| - name: Add Maestro to PATH | |
| run: echo "$HOME/.maestro/bin" >> $GITHUB_PATH | |
| - 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: Download APK artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ${{ needs.build_apk.outputs.apk-file-name }} | |
| path: dist | |
| - name: Run smoke test | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: x86_64 | |
| target: ${{ matrix.target }} | |
| script: | | |
| adb install -r dist/*.apk | |
| adb shell am set-debug-app --persistent org.learningequality.Kolibri | |
| adb shell am start -n org.learningequality.Kolibri/org.learningequality.Kolibri.WebViewActivity | |
| make smoke-test | |
| - name: Upload Maestro debug output | |
| if: always() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: maestro-debug-output-api-${{ matrix.api-level }} | |
| path: ~/.maestro/tests/ |