Github Actions on kivy-ios
This commit is contained in:
parent
a583d5db07
commit
57afc7d8f9
2 changed files with 51 additions and 0 deletions
27
.ci/rebuild_updated_recipes.py
Normal file
27
.ci/rebuild_updated_recipes.py
Normal file
|
@ -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.")
|
24
.github/workflows/kivy_ios.yml
vendored
Normal file
24
.github/workflows/kivy_ios.yml
vendored
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue