Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .buildkite/build.sh

This file was deleted.

10 changes: 0 additions & 10 deletions .buildkite/pipeline.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions .dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ updates:
- "actions/*"
# Maintain dependencies for Gradle
- package-ecosystem: "gradle"
directory: "python-for-android/dists/kolibri"
directory: "/app"
schedule:
interval: "monthly"
time: "00:00"
Expand Down
138 changes: 138 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
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,
});

const latestRelease = releases[0];
const tarAsset = latestRelease.assets.find(asset => asset.name.endsWith('.tar.gz'));
return tarAsset.browser_download_url;

- name: Download Kolibri tar
id: get_tar
run: |
make get-tar tar="${{ steps.get_release.outputs.result }}"
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
needs: [pre_job, build_apk]
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'
- 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: 30
arch: x86_64
target: google_apis
script: |
adb install -r dist/*.apk
adb shell am set-debug-app --persistent org.learningequality.Kolibri
make smoke-test
- name: Upload Maestro debug output
if: always()
uses: actions/upload-artifact@v6
with:
name: maestro-debug-output
path: ~/.maestro/tests/
53 changes: 12 additions & 41 deletions .github/workflows/build_apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,60 +102,31 @@ jobs:
# of whether this is being run from the local repository with workflow_dispatch
# or from another repository with workflow_call.
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install Apt Dependencies
# Dependencies installed here are taken from the buildozer Dockerfile:
# https://github.com/kivy/buildozer/blob/master/Dockerfile#L45
# with items that are already installed on the Ubuntu 22.04 image removed:
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#installed-apt-packages
run: |
sudo apt update -qq > /dev/null \
&& DEBIAN_FRONTEND=noninteractive sudo apt install -qq --yes --no-install-recommends \
build-essential \
ccache \
cmake \
gettext \
libffi-dev \
libltdl-dev \
patch \
zlib1g-dev
- uses: actions/cache@v5
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
# This is where python for android puts its intermediary build
# files - we cache this to improve build performance, but be
# aggressive in clearing the cache whenever any file changes
# in the repository, especially as we commit files to this folder
# too, so we don't want the cache to override these files.
# We achieve this by just caching on the currently checked out commit.
# Every time we update this repository, this commit will change,
# but repeated workflow calls for this commit will use the cache.
path: ./python-for-android
key: ${{ runner.os }}-python-for-android-${{ steps.get-commit.outputs.sha }}
- uses: actions/cache@v5
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
python-version: "3.10"
cache: 'pip'
- name: Download the tarfile from URL for workflow_dispatch
if: ${{ github.event.inputs.tar-url }}
run: make get-tar tar=${{ github.event.inputs.tar-url }}
run: make get-tar tar="${{ github.event.inputs.tar-url }}"
- name: Download the tarfile from URL for workflow_call
if: ${{ inputs.tar-url }}
run: make get-tar tar=${{ inputs.tar-url }}
run: make get-tar tar="${{ inputs.tar-url }}"
- name: Download the tarfile from artifacts
if: ${{ inputs.tar-file-name }}
uses: actions/download-artifact@v7
with:
name: ${{ inputs.tar-file-name }}
path: tar
- name: Install dependencies
run: pip install -r requirements.txt
- name: Ensure that Android SDK dependencies are installed
run: make setup
run: pip install -r build-requirements.txt -r requirements.txt
- name: Build the aab
if: ${{ inputs.release == true || github.event.inputs.release == 'true' }}
env:
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/pr_build.yml

This file was deleted.

11 changes: 9 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
github_token: ${{ github.token }}
paths_ignore: '["**.po", "**.json"]'
Expand All @@ -30,5 +30,12 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: "3.10"
cache: 'pip'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- uses: pre-commit/action@v3.0.1
13 changes: 4 additions & 9 deletions .github/workflows/release_apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,12 @@ jobs:
with:
repository: learningequality/kolibri-installer-android
ref: ${{ inputs.ref }}
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: 3.9
- uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt
run: pip install -r build-requirements.txt
- name: Release APK
run: python scripts/play_store_api.py release "${{ inputs.version-code }}"
Loading