diff --git a/.ci/rebuild_updated_recipes.py b/.ci/rebuild_updated_recipes.py new file mode 100644 index 0000000..82a30a0 --- /dev/null +++ b/.ci/rebuild_updated_recipes.py @@ -0,0 +1,27 @@ +import sh +import shutil +import subprocess + +def modified_recipes(branch='origin/master'): + """ + Returns a set of modified recipes between the current branch and the one + in param. + """ + # using the contrib version on purpose rather than sh.git, since it comes + # with a bunch of fixes, e.g. disabled TTY, see: + # https://stackoverflow.com/a/20128598/185510 + sh.contrib.git.fetch("origin", "master") + git_diff = sh.contrib.git.diff('--name-only', branch) + recipes = set() + for file_path in git_diff: + if 'recipes/' in file_path: + recipe = file_path.split('/')[1] + recipes.add(recipe) + return recipes + +if __name__ == "__main__": + updated_recipes = " ".join(modified_recipes()) + if updated_recipes != '': + subprocess.run(f"python3 toolchain.py build {updated_recipes}", shell=True, check=True) + else: + print("Nothing to do. No updated recipes.") \ No newline at end of file diff --git a/.github/workflows/kivy_ios.yml b/.github/workflows/kivy_ios.yml new file mode 100644 index 0000000..b1deb1b --- /dev/null +++ b/.github/workflows/kivy_ios.yml @@ -0,0 +1,24 @@ +name: kivy-ios + +on: [push, pull_request] + +jobs: + build_updated_recipes: + runs-on: macos-latest + steps: + - name: Checkout kivy-ios + uses: actions/checkout@v2 + - name: Set up Python 3.7.x + uses: actions/setup-python@v1 + with: + python-version: 3.7.x + - name: Install requirements + run: | + pip3 install -r requirements.txt + pip3 install sh + brew install autoconf automake libtool pkg-config + brew link libtool + pip3 install Cython==0.29.10 + - name: Build updated recipes + run: | + python3 .ci/rebuild_updated_recipes.py