Skip to content

Commit

Permalink
[CI] Remove the template explosion in the CI via a matrix (#15340)
Browse files Browse the repository at this point in the history
* [CI] Remove the template explosion in the CI via a matrix

This PR is a continuation of #15334
the removes the exact same problem but with the iOS device tests rather
than with the android tests.

Uses the exact same approach, moves from using a template explosion to a
matrix with the diff combinations.

* Lower case looks much better.
  • Loading branch information
mandel-macaque committed May 31, 2023
1 parent 75347d5 commit c8a6093
Showing 1 changed file with 32 additions and 27 deletions.
59 changes: 32 additions & 27 deletions eng/pipelines/common/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ stages:
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_API_${{ api }}:
${{ if ge(api, 24) }}:
ANDROID_EMULATORS: "system-images;android-${{ api }};google_apis_playstore;x86"
${{ if lt(api, 24) }}:
${{ else }}:
ANDROID_EMULATORS: "system-images;android-${{ api }};google_apis;x86"
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
PROJECT_PATH: ${{ project.android }}
Expand All @@ -57,29 +57,34 @@ stages:
displayName: iOS Device Tests
dependsOn: []
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.ios, '') }}:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: ios_device_tests_${{ project.name }}_${{ replace(version, '.', '_') }}
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }})
pool: ${{ parameters.iosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
steps:
- template: device-tests-steps.yml
parameters:
platform: ios
path: ${{ project.ios }}
${{ if eq(version, 'latest') }}:
device: ios-simulator-64
${{ if ne(version, 'latest') }}:
device: ios-simulator-64_${{ version }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
artifactName: ${{ parameters.artifactName }}
artifactItemPattern: ${{ parameters.artifactItemPattern }}
checkoutDirectory: ${{ parameters.checkoutDirectory }}
useArtifacts: ${{ parameters.useArtifacts }}
- job: ios_device_tests
workspace:
clean: all
displayName: "iOS simulator tests"
pool: ${{ parameters.iosPool }}
strategy:
matrix:
# create all the variables used for the matrix
${{ each project in parameters.projects }}:
${{ if ne(project.ios, '') }}:
${{ each version in parameters.iosVersions }}:
${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
PROJECT_PATH: ${{ project.ios }}
${{ if eq(version, 'latest') }}:
DEVICE: ios-simulator-64
${{ else }}:
DEVICE: ios-simulator-64_${{ version }}
steps:
- template: device-tests-steps.yml
parameters:
platform: ios
path: $(PROJECT_PATH)
device: $(DEVICE)
provisionatorChannel: ${{ parameters.provisionatorChannel }}
agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
artifactName: ${{ parameters.artifactName }}
artifactItemPattern: ${{ parameters.artifactItemPattern }}
checkoutDirectory: ${{ parameters.checkoutDirectory }}
useArtifacts: ${{ parameters.useArtifacts }}

0 comments on commit c8a6093

Please sign in to comment.