|
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 | + testSelect: "native" |
| 26 | + android_311: |
| 27 | + imageName: "ubuntu-latest" |
| 28 | + pythonVersion: "3.11" |
| 29 | + testSelect: "android" |
| 30 | + macos_311: |
| 31 | + imageName: "macos-latest" |
| 32 | + pythonVersion: "3.11" |
| 33 | + testSelect: "native" |
| 34 | + ios_311: |
| 35 | + imageName: "macos-latest" |
| 36 | + pythonVersion: "3.11" |
| 37 | + testSelect: "ios" |
| 38 | + android_macos_311: |
| 39 | + imageName: "macos-latest" |
| 40 | + pythonVersion: "3.11" |
| 41 | + testSelect: "android" |
| 42 | + windows_311: |
| 43 | + imageName: "windows-latest" |
| 44 | + pythonVersion: "3.11" |
| 45 | + testSelect: "native" |
20 | 46 | timeoutInMinutes: 180 |
21 | | - pool: {vmImage: 'ubuntu-latest'} |
| 47 | + pool: |
| 48 | + vmImage: $(imageName) |
| 49 | + |
22 | 50 | steps: |
23 | 51 | - task: UsePythonVersion@0 |
24 | 52 | inputs: |
25 | | - versionSpec: '3.11' |
| 53 | + versionSpec: $(pythonVersion) |
| 54 | + |
26 | 55 | - task: JavaToolInstaller@0 |
| 56 | + condition: and(eq(variables['testSelect'], 'android'), eq(variables['Agent.OS'], 'Linux')) |
27 | 57 | inputs: |
28 | 58 | versionSpec: '17' |
29 | 59 | jdkArchitectureOption: 'x64' |
30 | 60 | jdkSourceOption: 'PreInstalled' |
31 | | - - bash: | |
32 | | - docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all |
33 | | - python -m pip install -U pip |
34 | | - python -m pip install -e. --group test |
35 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
36 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
37 | | - export CIBW_ENABLE=all |
38 | | - else |
39 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
40 | | - fi |
41 | | - python ./bin/run_tests.py |
42 | 61 |
|
43 | | -- job: macos_311 |
44 | | - pool: {vmImage: 'macOS-latest'} |
45 | | - timeoutInMinutes: 120 |
46 | | - steps: |
47 | | - - task: UsePythonVersion@0 |
48 | | - inputs: |
49 | | - versionSpec: '3.11' |
50 | | - - bash: | |
51 | | - python -m pip install -U pip |
52 | | - python -m pip install -e. --group test |
53 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
54 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
55 | | - export CIBW_ENABLE=all |
56 | | - else |
57 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
58 | | - fi |
59 | | - python ./bin/run_tests.py |
| 62 | + - bash: docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all |
| 63 | + condition: and(eq(variables['imageName'], 'ubuntu-latest'), eq(variables['testSelect'], 'native')) |
| 64 | + displayName: 'Install binfmt on Linux' |
| 65 | + |
| 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) |
60 | 72 |
|
61 | | -- job: windows_311 |
62 | | - pool: {vmImage: 'windows-latest'} |
63 | | - timeoutInMinutes: 180 |
64 | | - steps: |
65 | | - - task: UsePythonVersion@0 |
66 | | - inputs: |
67 | | - versionSpec: '3.11' |
68 | 73 | - bash: | |
69 | | - python -m pip install -U pip |
70 | | - python -m pip install -e. --group test |
71 | | - if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then |
72 | | - echo "INFO: Exporting CIBW_ENABLE=all for main branch test run." |
73 | | - export CIBW_ENABLE=all |
74 | | - else |
75 | | - echo "INFO: CIBW_ENABLE not set for this branch ($(Build.SourceBranch))." |
76 | | - fi |
77 | | - python ./bin/run_tests.py |
| 74 | + echo "CIBW_ENABLE = $CIBW_ENABLE" |
| 75 | + python ./bin/run_tests.py --test-select $(testSelect) |
| 76 | + displayName: 'Run tests' |
0 commit comments