|
| 1 | +name: NuGetGallery CI $(Build.BuildId) |
| 2 | + |
| 3 | +trigger: |
| 4 | + branches: |
| 5 | + include: |
| 6 | + - main |
| 7 | + - dev |
| 8 | + batch: True |
| 9 | + |
| 10 | +pr: |
| 11 | + branches: |
| 12 | + include: |
| 13 | + - "*" |
| 14 | + |
| 15 | +variables: |
| 16 | + - name: BuildConfiguration |
| 17 | + value: Release |
| 18 | + - name: Codeql.Enabled |
| 19 | + value: true |
| 20 | + - name: NugetSecurityAnalysisWarningLevel |
| 21 | + value: none |
| 22 | + - name: nugetMultiFeedWarnLevel |
| 23 | + value: none |
| 24 | + - name: CommonPackageVersion |
| 25 | + value: $(CommonAssemblyVersion)-$(SemverFriendlyBranchName)-$(Build.BuildId) |
| 26 | + - name: CommonAssemblyVersion |
| 27 | + value: 5.0.0 |
| 28 | + - name: GalleryPackageVersion |
| 29 | + value: $(GalleryAssemblyVersion)-$(SemverFriendlyBranchName)-$(Build.BuildId) |
| 30 | + - name: GalleryAssemblyVersion |
| 31 | + value: 5.0.0 |
| 32 | + - name: JobsPackageVersion |
| 33 | + value: $(JobsAssemblyVersion)-$(SemverFriendlyBranchName)-$(Build.BuildId) |
| 34 | + - name: JobsAssemblyVersion |
| 35 | + value: 5.0.0 |
| 36 | + - name: NuGetGalleryDirectory |
| 37 | + value: ng |
| 38 | + - name: NuGetGalleryPath |
| 39 | + value: $(Agent.BuildDirectory)\$(NuGetGalleryDirectory) |
| 40 | + - name: NuGetGalleryBranch |
| 41 | + value: $(Build.SourceBranchName) |
| 42 | + - name: SemverFriendlyBranchName |
| 43 | + value: ${{ replace(replace(variables['Build.SourceBranchName'], '_', '-'), '/', '-') }} |
| 44 | + |
| 45 | +resources: |
| 46 | + repositories: |
| 47 | + - repository: self |
| 48 | + type: git |
| 49 | + ref: refs/heads/main |
| 50 | + |
| 51 | +pool: |
| 52 | + name: NetCore-Public |
| 53 | + demands: ImageOverride -equals windows.vs2026.amd64.open |
| 54 | + |
| 55 | +stages: |
| 56 | + - stage: common |
| 57 | + displayName: NuGet.Server.Common.sln |
| 58 | + dependsOn: [] |
| 59 | + jobs: |
| 60 | + - job: build_and_test |
| 61 | + displayName: common build and test |
| 62 | + cancelTimeoutInMinutes: 1 |
| 63 | + steps: |
| 64 | + - checkout: self |
| 65 | + fetchDepth: 1 |
| 66 | + clean: true |
| 67 | + fetchTags: false |
| 68 | + path: $(NuGetGalleryDirectory) |
| 69 | + - task: UseDotNet@2 |
| 70 | + displayName: Install .NET 8.0 SDK |
| 71 | + inputs: |
| 72 | + packageType: sdk |
| 73 | + version: 8.0.x |
| 74 | + - task: PowerShell@1 |
| 75 | + name: build |
| 76 | + displayName: Build |
| 77 | + inputs: |
| 78 | + scriptName: $(NuGetGalleryPath)\build.ps1 |
| 79 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipArtifacts -SkipGallery -SkipJobs -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion) |
| 80 | + workingFolder: $(NuGetGalleryPath) |
| 81 | + - task: PowerShell@1 |
| 82 | + name: test |
| 83 | + displayName: Run tests |
| 84 | + inputs: |
| 85 | + scriptName: $(NuGetGalleryPath)\test.ps1 |
| 86 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipGallery -SkipJobs |
| 87 | + workingFolder: $(NuGetGalleryPath) |
| 88 | + - task: PublishTestResults@2 |
| 89 | + name: publish_test_results |
| 90 | + displayName: Publish test results |
| 91 | + condition: succeededOrFailed() |
| 92 | + inputs: |
| 93 | + testRunner: VSTest |
| 94 | + testResultsFiles: $(NuGetGalleryPath)\Results.*.xml |
| 95 | + failTaskOnFailedTests: true |
| 96 | + |
| 97 | + - stage: gallery |
| 98 | + displayName: NuGetGallery.sln |
| 99 | + dependsOn: [] |
| 100 | + jobs: |
| 101 | + - job: build_and_test |
| 102 | + displayName: gallery build and test |
| 103 | + cancelTimeoutInMinutes: 1 |
| 104 | + steps: |
| 105 | + - checkout: self |
| 106 | + fetchDepth: 1 |
| 107 | + clean: true |
| 108 | + fetchTags: false |
| 109 | + path: $(NuGetGalleryDirectory) |
| 110 | + - task: UseDotNet@2 |
| 111 | + displayName: Install .NET 8.0 SDK |
| 112 | + inputs: |
| 113 | + packageType: sdk |
| 114 | + version: 8.0.x |
| 115 | + - task: PowerShell@1 |
| 116 | + name: build |
| 117 | + displayName: Build |
| 118 | + inputs: |
| 119 | + scriptName: $(NuGetGalleryPath)\build.ps1 |
| 120 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipArtifacts -SkipCommon -SkipJobs -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion) |
| 121 | + workingFolder: $(NuGetGalleryPath) |
| 122 | + - task: PowerShell@1 |
| 123 | + name: test |
| 124 | + displayName: Run tests |
| 125 | + inputs: |
| 126 | + scriptName: $(NuGetGalleryPath)\test.ps1 |
| 127 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipCommon -SkipJobs |
| 128 | + workingFolder: $(NuGetGalleryPath) |
| 129 | + - task: PublishTestResults@2 |
| 130 | + name: publish_test_results |
| 131 | + displayName: Publish test results |
| 132 | + condition: succeededOrFailed() |
| 133 | + inputs: |
| 134 | + testRunner: VSTest |
| 135 | + testResultsFiles: $(NuGetGalleryPath)\Results.*.xml |
| 136 | + failTaskOnFailedTests: true |
| 137 | + |
| 138 | + - stage: statslogparser |
| 139 | + displayName: StatsLogPasrser |
| 140 | + dependsOn: [] |
| 141 | + jobs: |
| 142 | + - job: build_and_test |
| 143 | + displayName: statslogparser build and test |
| 144 | + cancelTimeoutInMinutes: 1 |
| 145 | + variables: |
| 146 | + PIPX_HOME: $(Agent.ToolsDirectory)\pipx |
| 147 | + steps: |
| 148 | + - checkout: self |
| 149 | + fetchDepth: 1 |
| 150 | + clean: true |
| 151 | + fetchTags: false |
| 152 | + path: $(NuGetGalleryDirectory) |
| 153 | + - task: UsePythonVersion@0 |
| 154 | + inputs: |
| 155 | + versionSpec: '3.10' |
| 156 | + - script: | |
| 157 | + python -m pip install --user pipx |
| 158 | + set PATH=%USERPROFILE%\.local\bin;%PATH% |
| 159 | + pipx install poetry |
| 160 | + poetry install |
| 161 | + poetry build |
| 162 | + poetry run pytest tests/ --cov loginterpretation --cov-report html |
| 163 | + displayName: 'Install tools and run tests' |
| 164 | + workingDirectory: $(NuGetGalleryPath)\python\StatsLogParser |
| 165 | + - task: PublishPipelineArtifact@1 |
| 166 | + inputs: |
| 167 | + targetPath: $(NuGetGalleryPath)\python\StatsLogParser\dist |
| 168 | + artifact: StatsLogParser |
| 169 | + |
| 170 | + - stage: jobs |
| 171 | + displayName: NuGet.Jobs.sln |
| 172 | + dependsOn: [] |
| 173 | + jobs: |
| 174 | + - job: build_and_test |
| 175 | + displayName: jobs build and test |
| 176 | + cancelTimeoutInMinutes: 1 |
| 177 | + steps: |
| 178 | + - checkout: self |
| 179 | + fetchDepth: 1 |
| 180 | + clean: true |
| 181 | + fetchTags: false |
| 182 | + path: $(NuGetGalleryDirectory) |
| 183 | + - task: UseDotNet@2 |
| 184 | + displayName: Install .NET 8.0 SDK |
| 185 | + inputs: |
| 186 | + packageType: sdk |
| 187 | + version: 8.0.x |
| 188 | + - task: PowerShell@1 |
| 189 | + name: build |
| 190 | + displayName: Build |
| 191 | + inputs: |
| 192 | + scriptName: $(NuGetGalleryPath)\build.ps1 |
| 193 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipArtifacts -SkipCommon -SkipGallery -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion) |
| 194 | + workingFolder: $(NuGetGalleryPath) |
| 195 | + - task: PowerShell@1 |
| 196 | + name: test |
| 197 | + displayName: Run tests |
| 198 | + inputs: |
| 199 | + scriptName: $(NuGetGalleryPath)\test.ps1 |
| 200 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -SkipCommon -SkipGallery |
| 201 | + workingFolder: $(NuGetGalleryPath) |
| 202 | + - task: PublishTestResults@2 |
| 203 | + name: publish_test_results |
| 204 | + displayName: Publish test results |
| 205 | + condition: succeededOrFailed() |
| 206 | + inputs: |
| 207 | + testRunner: VSTest |
| 208 | + testResultsFiles: $(NuGetGalleryPath)\Results.*.xml |
| 209 | + failTaskOnFailedTests: true |
| 210 | + |
| 211 | + - stage: artifacts |
| 212 | + displayName: Artifacts |
| 213 | + dependsOn: [] |
| 214 | + jobs: |
| 215 | + - job: build_artifacts |
| 216 | + displayName: build |
| 217 | + cancelTimeoutInMinutes: 1 |
| 218 | + steps: |
| 219 | + - checkout: self |
| 220 | + fetchDepth: 1 |
| 221 | + clean: true |
| 222 | + fetchTags: false |
| 223 | + path: $(NuGetGalleryDirectory) |
| 224 | + - task: UseDotNet@2 |
| 225 | + displayName: Install .NET 8.0 SDK |
| 226 | + inputs: |
| 227 | + packageType: sdk |
| 228 | + version: 8.0.x |
| 229 | + - task: PowerShell@1 |
| 230 | + name: build_artifacts |
| 231 | + displayName: Build |
| 232 | + inputs: |
| 233 | + scriptName: $(NuGetGalleryPath)\build.ps1 |
| 234 | + arguments: -Configuration $(BuildConfiguration) -BuildNumber $(Build.BuildId) -CommonAssemblyVersion $(CommonAssemblyVersion) -CommonPackageVersion $(CommonPackageVersion) -GalleryAssemblyVersion $(GalleryAssemblyVersion) -GalleryPackageVersion $(GalleryPackageVersion) -JobsAssemblyVersion $(JobsAssemblyVersion) -JobsPackageVersion $(JobsPackageVersion) -Branch $(NuGetGalleryBranch) -CommitSHA $(Build.SourceVersion) |
| 235 | + workingFolder: $(NuGetGalleryPath) |
0 commit comments