|
16 | 16 | - noxfile.py |
17 | 17 |
|
18 | 18 | jobs: |
19 | | -- job: linux_311 |
| 19 | +- job: tests |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + linux_311: |
| 23 | + imageName: "ubuntu-latest" |
| 24 | + pythonVersion: "3.11" |
| 25 | + platformName: "native" |
| 26 | + android_311: |
| 27 | + imageName: "ubuntu-latest" |
| 28 | + pythonVersion: "3.11" |
| 29 | + platformName: "android" |
| 30 | + macos_311: |
| 31 | + imageName: "macos-latest" |
| 32 | + pythonVersion: "3.11" |
| 33 | + platformName: "native" |
| 34 | + ios_311: |
| 35 | + imageName: "macos-latest" |
| 36 | + pythonVersion: "3.11" |
| 37 | + platformName: "ios" |
| 38 | + android_macos_311: |
| 39 | + imageName: "macos-latest" |
| 40 | + pythonVersion: "3.11" |
| 41 | + platformName: "android" |
| 42 | + windows_311: |
| 43 | + imageName: "windows-latest" |
| 44 | + pythonVersion: "3.11" |
| 45 | + platformName: "native" |
20 | 46 | timeoutInMinutes: 180 |
21 | | - pool: {vmImage: 'ubuntu-latest'} |
22 | | - steps: |
23 | | - - task: UsePythonVersion@0 |
24 | | - inputs: |
25 | | - versionSpec: '3.11' |
26 | | - - bash: | |
27 | | - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all |
28 | | - python -m pip install -U pip |
29 | | - python -m pip install -e. --group test |
30 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
31 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
32 | | - export CIBW_ENABLE=all |
33 | | - else |
34 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
35 | | - fi |
36 | | - python ./bin/run_tests.py --platform=native |
| 47 | + pool: |
| 48 | + vmImage: $(imageName) |
37 | 49 |
|
38 | | -- job: android_313 |
39 | | - timeoutInMinutes: 180 |
40 | | - pool: {vmImage: 'ubuntu-latest'} |
41 | 50 | steps: |
42 | 51 | - task: UsePythonVersion@0 |
43 | 52 | inputs: |
44 | | - versionSpec: '3.13' |
| 53 | + versionSpec: $(pythonVersion) |
| 54 | + |
45 | 55 | - task: JavaToolInstaller@0 |
| 56 | + condition: eq(variables['platformName'], 'android') |
46 | 57 | inputs: |
47 | 58 | versionSpec: '17' |
48 | 59 | jdkArchitectureOption: 'x64' |
49 | 60 | jdkSourceOption: 'PreInstalled' |
50 | | - - bash: | |
51 | | - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all |
52 | | - python -m pip install -U pip |
53 | | - python -m pip install -e. --group test |
54 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
55 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
56 | | - export CIBW_ENABLE=all |
57 | | - else |
58 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
59 | | - fi |
60 | | - python ./bin/run_tests.py --platform=android |
61 | 61 |
|
62 | | -- job: macos_311 |
63 | | - pool: {vmImage: 'macOS-latest'} |
64 | | - timeoutInMinutes: 120 |
65 | | - steps: |
66 | | - - task: UsePythonVersion@0 |
67 | | - inputs: |
68 | | - versionSpec: '3.11' |
69 | | - - bash: | |
70 | | - python -m pip install -U pip |
71 | | - python -m pip install -e. --group test |
72 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
73 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
74 | | - export CIBW_ENABLE=all |
75 | | - else |
76 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
77 | | - fi |
78 | | - python ./bin/run_tests.py --platform=native |
| 62 | + - bash: docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all |
| 63 | + condition: and(eq(variables['imageName'], 'ubuntu-latest'), eq(variables['platformName'], 'native')) |
| 64 | + displayName: 'Install binfmt on Linux' |
79 | 65 |
|
80 | | -- job: ios_313 |
81 | | - pool: {vmImage: 'macOS-latest'} |
82 | | - timeoutInMinutes: 120 |
83 | | - steps: |
84 | | - - task: UsePythonVersion@0 |
85 | | - inputs: |
86 | | - versionSpec: '3.13' |
87 | | - - bash: | |
88 | | - python -m pip install -U pip |
89 | | - python -m pip install -e. --group test |
90 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
91 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
92 | | - export CIBW_ENABLE=all |
93 | | - else |
94 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
95 | | - fi |
96 | | - python ./bin/run_tests.py --platform ios && python ./bin/run_tests.py --platform android |
| 66 | + - bash: python -m pip install -U pip && python -m pip install -e. --group test |
| 67 | + displayName: 'Update pip and install cibuildwheel --group test' |
| 68 | + |
| 69 | + - bash: echo "##vso[task.setvariable variable=CIBW_ENABLE;all]" |
| 70 | + condition: eq(variables['Build.SourceBranch'], 'refs/heads/main') |
| 71 | + displayName: Set CIBW_ENABLE to all (main branch) |
97 | 72 |
|
98 | | -- job: windows_311 |
99 | | - pool: {vmImage: 'windows-latest'} |
100 | | - timeoutInMinutes: 180 |
101 | | - steps: |
102 | | - - task: UsePythonVersion@0 |
103 | | - inputs: |
104 | | - versionSpec: '3.11' |
105 | 73 | - bash: | |
106 | | - python -m pip install -U pip |
107 | | - python -m pip install -e. --group test |
108 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
109 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
110 | | - export CIBW_ENABLE=all |
111 | | - else |
112 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
113 | | - fi |
114 | | - python ./bin/run_tests.py |
| 74 | + echo "CIBW_ENABLE = $CIBW_ENABLE" |
| 75 | + python ./bin/run_tests.py --platform $(platformName) |
| 76 | + displayName: 'Run tests' |
0 commit comments