Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Common Matrix Generation #38324

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
34 changes: 20 additions & 14 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,26 @@ jobs:
MatrixConfigs: ${{ parameters.MatrixConfigs }}
MatrixFilters: ${{ parameters.MatrixFilters }}
MatrixReplace: ${{ parameters.MatrixReplace }}
PreGenerationSteps:

- template: /eng/pipelines/templates/steps/download-package-artifacts.yml

- task: Powershell@2
inputs:
pwsh: true
filePath: eng/scripts/distribute-packages-to-matrix.ps1
arguments: >-
-PackageInfoFolder "$(Build.ArtifactStagingDirectory)/PackageInfo"
-PlatformMatrix "${{ parameters.MatrixConfigs[0].Path }}"
displayName: 'Distribute Packages to Matrix'
condition: and(eq(variables['Build.Reason'], 'PullRequest'), eq('${{ parameters.ServiceDirectory }}','auto'))

${{ if eq(parameters.ServiceDirectory, 'auto') }}:
SparseCheckoutPaths:
- "**/setup.py"
- "**/pyproject.toml"
- "tools/"
- "**/ci*.yml"
- "**/_version.py"
- "**/version.py"
- "**/README.md"
- "**/CHANGELOG.md"
- "**/*matrix*.json"
EnablePRGeneration: true
PRMatrixSetting: "TargetingString"
PreGenerationSteps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
- template: /eng/common/pipelines/templates/steps/save-package-properties.yml
parameters:
ServiceDirectory: ${{parameters.ServiceDirectory}}
CloudConfig:
Cloud: Public
AdditionalParameters:
Expand Down
54 changes: 3 additions & 51 deletions eng/pipelines/templates/steps/build-package-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,57 +59,9 @@ steps:
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}

# now we need to call Save-Package-Properties so that we can filter on it
- ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}:
- pwsh: |
mkdir -p $(Build.ArtifactStagingDirectory)/diff
displayName: Create PR Diff Folder

- pwsh: |
$location = Join-Path "$(Build.ArtifactStagingDirectory)" "diff"

Write-Host "./eng/common/scripts/Generate-PR-Diff.ps1 -TargetPath `"$(Build.SourcesDirectory)`" -ArtifactPath `"$location`""
./eng/common/scripts/Generate-PR-Diff.ps1 -TargetPath "$(Build.SourcesDirectory)" -ArtifactPath "$location"
displayName: Generate PR Diff

- pwsh: |
Write-Host "We freshly generated the PR diff, and this is what it sees!"
Get-ChildItem -R -Force $(Build.ArtifactStagingDirectory)/diff | % { $_.FullName }
cat $(Build.ArtifactStagingDirectory)/diff/diff.json
displayName: Dump PR Diff

- task: Powershell@2
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
arguments: >
-PrDiff $(Build.ArtifactStagingDirectory)/diff/diff.json
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Save package properties filtered for PR

- ${{ else }}:
- task: Powershell@2
condition: and(succeeded(), eq(variables['SetDevVersion'],'true'))
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory ${{parameters.ServiceDirectory}}
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
-AddDevVersion
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Save package properties with dev version
- task: Powershell@2
condition: and(succeeded(), ne(variables['SetDevVersion'],'true'))
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory ${{parameters.ServiceDirectory}}
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Save package properties for service
- template: /eng/common/pipelines/templates/steps/save-package-properties.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}

- template: /eng/pipelines/templates/steps/resolve-package-targeting.yml
parameters:
Expand Down
6 changes: 0 additions & 6 deletions sdk/attestation/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ extends:
parameters:
ServiceDirectory: attestation
TestProxy: true
# Override the base matrix due to https://github.com/Azure/azure-sdk-for-python/issues/17837
MatrixConfigs:
- Name: attestation_ci_matrix
Path: eng/pipelines/templates/stages/platform-matrix.json
Selection: sparse
GenerateVMJobs: true
Artifacts:
- name: azure-mgmt-attestation
safeName: azuremgmtattestation
Expand Down
7 changes: 2 additions & 5 deletions sdk/evaluation/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ extends:
TestProxy: true
# This custom matrix config should be dropped once:
# * Once azure-ai-ml supports 3.13 (currently crashes due to type annotation)
MatrixConfigs:
- Name: evaluation_ci_matrix
Path: eng/pipelines/templates/stages/platform-matrix-no-313.json
Selection: sparse
GenerateVMJobs: true
MatrixFilters:
- PythonVersion=^(?!3\.13)
Artifacts:
- name: azure-ai-evaluation
safeName: azureaievaluation
2 changes: 1 addition & 1 deletion sdk/identity/azure-identity/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
6 changes: 0 additions & 6 deletions sdk/keyvault/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ extends:
parameters:
ServiceDirectory: keyvault
TestProxy: true
# Override the base matrix due to https://github.com/Azure/azure-sdk-for-python/issues/17837
MatrixConfigs:
- Name: keyvault_ci_matrix
Path: eng/pipelines/templates/stages/platform-matrix.json
Selection: sparse
GenerateVMJobs: true
Artifacts:
- name: azure-keyvault-administration
safename: azurekeyvaultadministration
Expand Down
Loading