Add a github action to run a sample build to check output
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
name: Sample build
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_wheels:
|
||||||
|
name: Build wheels on ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-18.04]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
name: Install Python
|
||||||
|
with:
|
||||||
|
python-version: '3.7'
|
||||||
|
|
||||||
|
- name: Generate sample project
|
||||||
|
run: |
|
||||||
|
python -m test.test_projects test_0_basic.basic_project sample_project
|
||||||
|
|
||||||
|
- name: Build wheels
|
||||||
|
run: |
|
||||||
|
cd sample_project
|
||||||
|
python -m cibuildwheel --output-dir wheelhouse
|
||||||
@@ -11,21 +11,28 @@ def main():
|
|||||||
prog="python -m test.test_projects",
|
prog="python -m test.test_projects",
|
||||||
description='Generate a test project to check it out'
|
description='Generate a test project to check it out'
|
||||||
)
|
)
|
||||||
|
parser.add_argument('--open', action='store_true', help='''
|
||||||
|
Open the generated project in a file explorer
|
||||||
|
''')
|
||||||
parser.add_argument('PROJECT', help='''
|
parser.add_argument('PROJECT', help='''
|
||||||
Python path to a project object. E.g. test.test_0_basic.basic_project
|
Python path to a project object. E.g. test.test_0_basic.basic_project
|
||||||
''')
|
''')
|
||||||
|
parser.add_argument('OUTPUT', nargs='?', help='''
|
||||||
|
Path to output dir. If no dir is passed, a tempdir will be generated.
|
||||||
|
''')
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|
||||||
module, _, name = options.PROJECT.rpartition('.')
|
module, _, name = options.PROJECT.rpartition('.')
|
||||||
|
|
||||||
project = getattr(importlib.import_module(module), name)
|
project = getattr(importlib.import_module(module), name)
|
||||||
|
|
||||||
project_dir = Path(tempfile.mkdtemp())
|
project_dir = Path(options.OUTPUT or tempfile.mkdtemp())
|
||||||
project.generate(project_dir)
|
project.generate(project_dir)
|
||||||
|
|
||||||
print('Project generated at', project_dir)
|
print('Project generated at', project_dir)
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
if options.open:
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
subprocess.check_call(['open', '--', project_dir])
|
subprocess.check_call(['open', '--', project_dir])
|
||||||
elif sys.platform == 'linux2':
|
elif sys.platform == 'linux2':
|
||||||
|
|||||||
Reference in New Issue
Block a user