Run a sample build before tests on PRs with this label

This commit is contained in:
Joe Rickerby
2020-11-22 01:15:44 +00:00
parent 9d731cd440
commit a93cee1a30
2 changed files with 34 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
import argparse
import tempfile
from pathlib import Path
if __name__ == '__main__':
# move cwd to the project root
os.chdir(Path(__file__).resolve().parents[1])
parser = argparse.ArgumentParser(description='Runs a sample build')
parser.add_argument('PROJECT_PYTHON_PATH', nargs='?', default='test.test_0_basic.basic_project')
options = parser.parse_args()
print(options)
project_dir = tempfile.mkdtemp()
subprocess.run([sys.executable, '-m', 'test.test_projects', options.PROJECT_PYTHON_PATH, project_dir], check=True)
subprocess.run(['cibuildwheel'], check=True, cwd=project_dir)