├── README.md ├── azure-pipelines.yml ├── .gitignore └── generate-ap-matrices.py /README.md: -------------------------------------------------------------------------------- 1 | # azure-pipelines-matrix-experiment 2 | Demo on how to generate matrices on Azure Pipelines from a script. 3 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - job: MatricesGenerator 3 | steps: 4 | - task: UsePythonVersion@0 5 | inputs: 6 | versionSpec: '3.7' 7 | addToPath: true 8 | - bash: python generate-ap-matrices.py 9 | name: mtrx 10 | 11 | - job: LinuxRunner 12 | pool: 13 | vmImage: ubuntu-16.04 14 | dependsOn: MatricesGenerator 15 | strategy: 16 | matrix: $[ dependencies.MatricesGenerator.outputs['mtrx.linux'] ] 17 | steps: 18 | - script: env 19 | - job: MacRunner 20 | pool: 21 | vmImage: macOS-10.14 22 | dependsOn: MatricesGenerator 23 | strategy: 24 | matrix: $[ dependencies.MatricesGenerator.outputs['mtrx.mac'] ] 25 | steps: 26 | - script: env 27 | - job: WindowsRunner 28 | pool: 29 | vmImage: vs2017-win2016 30 | dependsOn: MatricesGenerator 31 | strategy: 32 | matrix: $[ dependencies.MatricesGenerator.outputs['mtrx.windows'] ] 33 | steps: 34 | - script: set -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### JetBrains template 3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 4 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 5 | 6 | # User-specific stuff 7 | .idea/**/workspace.xml 8 | .idea/**/tasks.xml 9 | .idea/**/dictionaries 10 | .idea/**/shelf 11 | 12 | # Sensitive or high-churn files 13 | .idea/**/dataSources/ 14 | .idea/**/dataSources.ids 15 | .idea/**/dataSources.local.xml 16 | .idea/**/sqlDataSources.xml 17 | .idea/**/dynamic.xml 18 | .idea/**/uiDesigner.xml 19 | .idea/**/dbnavigator.xml 20 | 21 | # Gradle 22 | .idea/**/gradle.xml 23 | .idea/**/libraries 24 | 25 | # CMake 26 | cmake-build-debug/ 27 | cmake-build-release/ 28 | 29 | # Mongo Explorer plugin 30 | .idea/**/mongoSettings.xml 31 | 32 | # File-based project format 33 | *.iws 34 | 35 | # IntelliJ 36 | out/ 37 | 38 | # mpeltonen/sbt-idea plugin 39 | .idea_modules/ 40 | 41 | # JIRA plugin 42 | atlassian-ide-plugin.xml 43 | 44 | # Cursive Clojure plugin 45 | .idea/replstate.xml 46 | 47 | # Crashlytics plugin (for Android Studio and IntelliJ) 48 | com_crashlytics_export_strings.xml 49 | crashlytics.properties 50 | crashlytics-build.properties 51 | fabric.properties 52 | 53 | # Editor-based Rest Client 54 | .idea/httpRequests 55 | ### Python template 56 | # Byte-compiled / optimized / DLL files 57 | __pycache__/ 58 | *.py[cod] 59 | *$py.class 60 | 61 | # C extensions 62 | *.so 63 | 64 | # Distribution / packaging 65 | .Python 66 | build/ 67 | develop-eggs/ 68 | dist/ 69 | downloads/ 70 | eggs/ 71 | .eggs/ 72 | lib/ 73 | lib64/ 74 | parts/ 75 | sdist/ 76 | var/ 77 | wheels/ 78 | *.egg-info/ 79 | .installed.cfg 80 | *.egg 81 | MANIFEST 82 | 83 | # PyInstaller 84 | # Usually these files are written by a python script from a template 85 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 86 | *.manifest 87 | *.spec 88 | 89 | # Installer logs 90 | pip-log.txt 91 | pip-delete-this-directory.txt 92 | 93 | # Unit test / coverage reports 94 | htmlcov/ 95 | .tox/ 96 | .coverage 97 | .coverage.* 98 | .cache 99 | nosetests.xml 100 | coverage.xml 101 | *.cover 102 | .hypothesis/ 103 | .pytest_cache/ 104 | 105 | # Translations 106 | *.mo 107 | *.pot 108 | 109 | # Django stuff: 110 | *.log 111 | local_settings.py 112 | db.sqlite3 113 | 114 | # Flask stuff: 115 | instance/ 116 | .webassets-cache 117 | 118 | # Scrapy stuff: 119 | .scrapy 120 | 121 | # Sphinx documentation 122 | docs/_build/ 123 | 124 | # PyBuilder 125 | target/ 126 | 127 | # Jupyter Notebook 128 | .ipynb_checkpoints 129 | 130 | # pyenv 131 | .python-version 132 | 133 | # celery beat schedule file 134 | celerybeat-schedule 135 | 136 | # SageMath parsed files 137 | *.sage.py 138 | 139 | # Environments 140 | .env 141 | .venv 142 | env/ 143 | venv/ 144 | ENV/ 145 | env.bak/ 146 | venv.bak/ 147 | 148 | # Spyder project settings 149 | .spyderproject 150 | .spyproject 151 | 152 | # Rope project settings 153 | .ropeproject 154 | 155 | # mkdocs documentation 156 | /site 157 | 158 | # mypy 159 | .mypy_cache/ 160 | 161 | .idea/ 162 | .vscode/ -------------------------------------------------------------------------------- /generate-ap-matrices.py: -------------------------------------------------------------------------------- 1 | """ 2 | This generates a matrix of QT versions to test downloading against 3 | """ 4 | import collections 5 | import json 6 | from itertools import product 7 | 8 | 9 | class BuildJob: 10 | def __init__(self, qt_version, host, target, arch, archdir): 11 | self.qt_version = qt_version 12 | self.host = host 13 | self.target = target 14 | self.arch = arch 15 | self.archdir = archdir 16 | 17 | 18 | class PlatformBuildJobs: 19 | def __init__(self, platform, build_jobs): 20 | self.platform = platform 21 | self.build_jobs = build_jobs 22 | 23 | 24 | python_versions = [ 25 | '3.7', 26 | ] 27 | 28 | qt_versions = [ 29 | '5.11.3', 30 | '5.12.3', 31 | '5.13.0' 32 | ] 33 | 34 | linux_build_jobs = [] 35 | mac_build_jobs = [] 36 | windows_build_jobs = [] 37 | 38 | all_platform_build_jobs = [ 39 | PlatformBuildJobs('linux', linux_build_jobs), 40 | PlatformBuildJobs('mac', mac_build_jobs), 41 | PlatformBuildJobs('windows', windows_build_jobs), 42 | ] 43 | 44 | # Linux Desktop 45 | 46 | for qt_version in qt_versions: 47 | linux_build_jobs.append( 48 | BuildJob(qt_version, 'linux', 'desktop', 'gcc_64', 'gcc_64') 49 | ) 50 | 51 | # Mac Desktop 52 | 53 | for qt_version in qt_versions: 54 | mac_build_jobs.append( 55 | BuildJob(qt_version, 'mac', 'desktop', 'clang_64', "clang_64") 56 | ) 57 | 58 | # Mac iOS 59 | mac_build_jobs.append( 60 | BuildJob('5.13.0', 'mac', 'ios', 'ios', 'ios') 61 | ) 62 | 63 | # Windows Desktop 64 | windows_build_jobs.extend( 65 | [ 66 | BuildJob('5.11.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'), 67 | BuildJob('5.11.3', 'windows', 'desktop', 'win32_msvc2015', 'msvc2015'), 68 | ] 69 | ) 70 | 71 | windows_build_jobs.extend( 72 | [ 73 | BuildJob('5.12.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'), 74 | BuildJob('5.12.3', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), 75 | ] 76 | ) 77 | 78 | windows_build_jobs.extend( 79 | [ 80 | BuildJob('5.13.0', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'), 81 | BuildJob('5.13.0', 'windows', 'desktop', 'win64_msvc2015_64', 'msvc2015_64'), 82 | BuildJob('5.13.0', 'windows', 'desktop', 'win64_mingw73', 'mingw73_64'), 83 | BuildJob('5.13.0', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), 84 | BuildJob('5.13.0', 'windows', 'desktop', 'win32_mingw73', 'mingw73_32'), 85 | ] 86 | ) 87 | 88 | # Androids for Linux platforms 89 | # aqt is for CI/CD systems! 90 | # Users might develop on Win/Mac, but are most likely to use Linux for CI/CD with 91 | # the Android ecosystem. 92 | 93 | for android_arch in ['android_x86', 'android_armv7']: 94 | linux_build_jobs.append( 95 | BuildJob('5.13.0', 'linux', 'android', android_arch, android_arch) 96 | ) 97 | 98 | matrices = {} 99 | 100 | for platform_build_job in all_platform_build_jobs: 101 | matrix_dictionary = collections.OrderedDict() 102 | 103 | for build_job, python_version in product(platform_build_job.build_jobs, python_versions): 104 | key = 'QT {} {} {} {}'.format(build_job.qt_version, build_job.host, build_job.target, 105 | build_job.arch) 106 | matrix_dictionary[key] = collections.OrderedDict( 107 | [ 108 | ('PYTHON_VERSION', python_version), 109 | ('QT_VERSION', build_job.qt_version), 110 | ('HOST', build_job.host), 111 | ('TARGET', build_job.target), 112 | ('ARCH', build_job.arch), 113 | ('ARCHDIR', build_job.archdir), 114 | ] 115 | ) 116 | 117 | matrices[platform_build_job.platform] = matrix_dictionary 118 | 119 | print("Setting Variables below") 120 | print(f"##vso[task.setVariable variable=linux;isOutput=true]{json.dumps(matrices['linux'])}") 121 | print(f"##vso[task.setVariable variable=windows;isOutput=true]{json.dumps(matrices['windows'])}") 122 | print(f"##vso[task.setVariable variable=mac;isOutput=true]{json.dumps(matrices['mac'])}") 123 | --------------------------------------------------------------------------------