appveyor: add cloning the dependency modules to 'prepare' action

This commit is contained in:
Ralph Lange
2020-04-08 15:14:40 +02:00
parent 4dcfbb2079
commit 249db7db22
3 changed files with 38 additions and 13 deletions
+8
View File
@@ -29,6 +29,7 @@ skip_commits:
- '**/*.html' - '**/*.html'
- '**/*.md' - '**/*.md'
#---------------------------------# #---------------------------------#
# build matrix configuration # # build matrix configuration #
#---------------------------------# #---------------------------------#
@@ -42,7 +43,14 @@ configuration:
# Environment variables: compiler toolchain # Environment variables: compiler toolchain
environment: environment:
# common variables
SETUP_PATH: .:.ci
SET: test01
matrix: matrix:
- CC: vs2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
SET: test00
- CC: mingw - CC: mingw
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- CC: vs2019 - CC: vs2019
+7 -7
View File
@@ -2,7 +2,7 @@
"""Module ci-scripts AppVeyor unit tests """Module ci-scripts AppVeyor unit tests
""" """
# SET=test00 in .appveyor.yml runs the tests in this script # SET=test00 in the environment (.appveyor.yml) runs the tests in this script
# all other jobs are started as compile jobs # all other jobs are started as compile jobs
from __future__ import print_function from __future__ import print_function
@@ -235,9 +235,9 @@ class TestDefaultModuleURLs(unittest.TestCase):
.format(mod, do.setup[mod + '_REPOURL'])) .format(mod, do.setup[mod + '_REPOURL']))
if __name__ == "__main__": if __name__ == "__main__":
# suite = unittest.TestLoader().loadTestsFromTestCase(TestSourceSet) if 'SET' in os.environ and os.environ['SET'] == "test00":
# suite = unittest.TestLoader().loadTestsFromTestCase(TestUpdateReleaseLocal) unittest.main()
# suite = unittest.TestLoader().loadTestsFromTestCase(TestAddDependency) else:
# suite = unittest.TestLoader().loadTestsFromTestCase(TestDefaultModuleURLs) do.actions['prepare']()
# unittest.TextTestRunner(verbosity=2).run(suite) do.actions['build']()
unittest.main() do.actions['test']()
+23 -6
View File
@@ -253,7 +253,7 @@ def add_dependency(dep, tag):
update_release_local(setup[dep+"_VARNAME"], place) update_release_local(setup[dep+"_VARNAME"], place)
os.chdir(curdir) os.chdir(curdir)
def prepare(args): def prepare():
print(sys.version) print(sys.version)
print('PYTHONPATH') print('PYTHONPATH')
for dname in sys.path: for dname in sys.path:
@@ -261,19 +261,36 @@ def prepare(args):
print('platform = ', distutils.util.get_platform()) print('platform = ', distutils.util.get_platform())
print('{0}Loading setup files{1}'.format(ANSI_YELLOW, ANSI_RESET)) print('{0}Loading setup files{1}'.format(ANSI_YELLOW, ANSI_RESET))
source_set('default') source_set('defaults')
if 'SET' in os.environ: if 'SET' in os.environ:
source_set(os.environ['SET']) source_set(os.environ['SET'])
# we're working with tags (detached heads) a lot: suppress advice # we're working with tags (detached heads) a lot: suppress advice
call_git(['config', '--global', 'advice.detachedHead', 'false']) call_git(['config', '--global', 'advice.detachedHead', 'false'])
print('Installing dependencies') print('{0}Checking/cloning dependencies{1}'.format(ANSI_YELLOW, ANSI_RESET))
def build(args): add_modules = ''
if 'ADD_MODULES' in os.environ:
add_modules = os.environ['ADD_MODULES']
modules = ''
if 'MODULES' in os.environ:
modules = os.environ['MODULES']
modlist = 'BASE {0} {1}'.format(add_modules, modules).upper().split()
for mod in modlist:
if not setup[mod].strip():
setup[mod] = 'master'
logger.debug('Adding dependency %s with tag %s', mod, setup[mod])
add_dependency(mod, setup[mod])
if os.path.isdir('configure'):
release_local = os.path.join(cachedir, 'RELEASE.local')
shutil.copy(release_local, 'configure')
def build():
print('Building the module') print('Building the module')
def test(args): def test():
print('Running the tests') print('Running the tests')
actions = { actions = {
@@ -287,4 +304,4 @@ if __name__=='__main__':
while len(args)>0: while len(args)>0:
name = args.pop(0) name = args.pop(0)
print('IN', name, 'with', args) print('IN', name, 'with', args)
actions[name](args) actions[name]()