-
Notifications
You must be signed in to change notification settings - Fork 346
Add ADO pipeline scaffolding #1762
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
16b8320
Add ADO pipeline scaffolding
hallipr 6495e23
Use relative paths in package properties
hallipr c09b9a4
Run tests instead of build
hallipr fc9e25e
Fix argument parsing
hallipr 13b628e
Disable link checking
hallipr 24da3d2
Target feature/track2 for pr trigger
hallipr 353d624
Move pr.yml to eng/pipelines
hallipr d459c9f
Empty commit
hallipr ef36c93
Skip test steps when no packages changed
hallipr 7b4b3ac
Remove RustToolchain redundant naming
hallipr b4d009f
Remove targetingString
hallipr 4b4b5fe
Add nightly to analyze job for -Zscript
hallipr 5eb75ba
Move dependency check command to test-pacakges
hallipr b524067
Update eng/scripts/Language-Settings.ps1
hallipr 6edc176
Address PR feedback
hallipr a23a4af
Remove reduntant parameters from pr.yml
hallipr 248164b
Make the verify-dependencies call conditional on toolchain
hallipr 859703f
Remove comments from settings.json
hallipr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| { | ||
| "cSpell.enabled": true, | ||
| "editor.formatOnSave": true, | ||
| "rust-analyzer.cargo.features": "all" | ||
| "rust-analyzer.cargo.features": "all", | ||
| "[powershell]": { | ||
| "editor.defaultFormatter": "ms-vscode.powershell", | ||
| }, | ||
| // the yaml formatter will use complex key notation to wrap long lines | ||
| // allow really long lines to prevent that. | ||
| "yaml.format.printWidth": 240 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "tool": "Credential Scanner", | ||
| "suppressions": [ | ||
| { | ||
| "placeholder": [ | ||
| "placeholder" | ||
| ], | ||
| "_justification": "Secret used by test code, it is fake." | ||
| }, | ||
| { | ||
| "file": [ | ||
| "eng/common/testproxy/dotnet-devcert.pfx" | ||
| ], | ||
| "_justification": "File contains private key used by test code." | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| trigger: none | ||
|
|
||
| pr: | ||
| branches: | ||
| include: | ||
| - main | ||
| - feature/* | ||
| - hotfix/* | ||
| - release/* | ||
|
|
||
| extends: | ||
| template: /eng/pipelines/templates/stages/archetype-sdk-client.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| parameters: | ||
| - name: ServiceDirectory | ||
| type: string | ||
| default: auto | ||
| - name: BeforeTestSteps | ||
| type: object | ||
| default: [] | ||
| - name: AfterTestSteps | ||
| type: object | ||
| default: [] | ||
| - name: TestTimeoutInMinutes | ||
| type: number | ||
| default: 60 | ||
| - name: BuildDocs | ||
| type: boolean | ||
| default: true | ||
| - name: TestProxy | ||
| type: boolean | ||
| default: false | ||
| - name: TestPipeline | ||
| type: boolean | ||
| default: false | ||
| - name: GenerateApiReviewForManualOnly | ||
| type: boolean | ||
| default: false | ||
| - name: BuildMatrix | ||
| type: object | ||
| default: | ||
| - pool: | ||
| os: linux | ||
| name: $(LINUXPOOL) | ||
| image: $(LINUXVMIMAGE) | ||
| Toolchains: | ||
| - name: stable | ||
| publish: true | ||
| - name: msrv | ||
| - name: nightly | ||
| - pool: | ||
| os: windows | ||
| name: $(WINDOWSPOOL) | ||
| image: $(WINDOWSVMIMAGE) | ||
| Toolchains: | ||
| - name: stable | ||
| - name: msrv | ||
| - name: nightly | ||
| - pool: | ||
| os: macOS | ||
| name: $(MACPOOL) | ||
| vmImage: $(MACVMIMAGE) | ||
| Toolchains: | ||
| - name: stable | ||
| - name: msrv | ||
| - name: nightly | ||
| - name: AnalyzeToolchains | ||
| type: object | ||
| default: [stable] | ||
|
|
||
| jobs: | ||
| - ${{ each matrix in parameters.BuildMatrix }}: | ||
| - ${{ each toolchain in matrix.Toolchains }}: | ||
| - job: Build_${{ matrix.pool.os }}_${{ toolchain.name }} | ||
| timeoutInMinutes: 90 | ||
|
|
||
| pool: ${{ matrix.pool }} | ||
|
|
||
| steps: | ||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
| Paths: [/*] | ||
|
|
||
| - template: /eng/pipelines/templates/steps/test-packages.yml | ||
| parameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| Toolchain: ${{ toolchain.name }} | ||
| ArtifactSuffix: ${{ matrix.pool.os }}_${{ toolchain.name }} | ||
| PublishArtifacts: ${{ eq(toolchain.publish, 'true') }} | ||
| UnitTests: true | ||
| FunctionalTests: ${{ ne(variables['Build.Reason'], 'PullRequest') }} | ||
|
|
||
| - ${{ each toolchain in parameters.AnalyzeToolchains }}: | ||
| - job: "Analyze_${{ toolchain }}" | ||
| condition: and(succeededOrFailed(), ne(variables['Skip.Analyze'], 'true')) | ||
| timeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} | ||
|
|
||
| pool: | ||
| os: linux | ||
| name: $(LINUXPOOL) | ||
| image: $(LINUXVMIMAGE) | ||
|
|
||
| steps: | ||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
| Paths: [/*] | ||
|
|
||
| - template: /eng/pipelines/templates/steps/analyze.yml | ||
| parameters: | ||
| Toolchain: ${{ toolchain }} | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/check-spelling.yml | ||
| parameters: | ||
| ContinueOnError: false | ||
|
|
||
| # Disabled until we fix crates.io link checking | ||
| # - template: /eng/common/pipelines/templates/steps/verify-links.yml | ||
| # parameters: | ||
| # ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: | ||
| # Directory: "" | ||
| # Urls: (eng/common/scripts/get-markdown-files-from-changed-files.ps1) | ||
| # ${{ elseif eq(parameters.ServiceDirectory, 'auto') }}: | ||
| # Directory: "" | ||
| # ${{ else }}: | ||
| # Directory: sdk/${{ parameters.ServiceDirectory }} | ||
| # CheckLinkGuidance: $true | ||
| # Condition: succeededOrFailed() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| resources: | ||
| repositories: | ||
| - repository: 1ESPipelineTemplates | ||
| type: git | ||
| name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
| ref: refs/tags/release | ||
| - repository: 1ESPipelineTemplatesCanary | ||
| type: git | ||
| name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
| ref: refs/tags/canary | ||
|
|
||
| parameters: | ||
| - name: stages | ||
| type: stageList | ||
| default: [] | ||
| - name: Use1ESOfficial | ||
| type: boolean | ||
| default: true | ||
| - name: oneESTemplateTag | ||
| type: string | ||
| default: release | ||
|
|
||
| extends: | ||
| ${{ if and(parameters.Use1ESOfficial, eq(parameters.oneESTemplateTag, 'canary')) }}: | ||
| template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplatesCanary | ||
| ${{ elseif eq(parameters.oneESTemplateTag, 'canary') }}: | ||
| template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplatesCanary | ||
| ${{ elseif and(parameters.Use1ESOfficial, eq(variables['System.TeamProject'], 'internal')) }}: | ||
| template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
| ${{ else }}: | ||
| template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates | ||
| parameters: | ||
| ${{ if eq(parameters.oneESTemplateTag, 'canary') }}: | ||
| # Enable 1es template team to verify validation has been run on canary | ||
| customBuildTags: | ||
| - 1ES.PT.Tag-refs/tags/canary | ||
| settings: | ||
| skipBuildTagsForGitHubPullRequests: true | ||
| sdl: | ||
| sourceAnalysisPool: | ||
| name: azsdk-pool-mms-win-2022-general | ||
| image: azsdk-pool-mms-win-2022-1espt | ||
| os: windows | ||
| eslint: | ||
|
hallipr marked this conversation as resolved.
|
||
| enabled: false | ||
| justificationForDisabling: "ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3556850" | ||
| codeql: | ||
| compiled: | ||
| enabled: false | ||
| justificationForDisabling: "CodeQL times our pipelines out by running for 2+ hours before being force canceled." | ||
| credscan: | ||
| suppressionsFile: $(Build.SourcesDirectory)/eng/CredScanSuppression.json | ||
| toolVersion: "2.3.12.23" | ||
| baselineFiles: $(Build.SourcesDirectory)/eng/python.gdnbaselines | ||
| psscriptanalyzer: | ||
| compiled: true | ||
| break: true | ||
| policy: M365 | ||
| # Turn off the build warnings caused by disabling some sdl checks | ||
| createAdoIssuesForJustificationsForDisablement: false | ||
| stages: ${{ parameters.stages }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| parameters: | ||
| - name: ServiceDirectory | ||
| type: string | ||
| default: auto | ||
| - name: TestTimeoutInMinutes | ||
| type: number | ||
| default: 60 | ||
| - name: BuildDocs | ||
| type: boolean | ||
| default: true | ||
| - name: TestProxy | ||
| type: boolean | ||
| default: true | ||
| - name: GenerateApiReviewForManualOnly | ||
| type: boolean | ||
| default: false | ||
| - name: oneESTemplateTag | ||
| type: string | ||
| default: release | ||
|
|
||
| extends: | ||
| template: /eng/pipelines/templates/stages/1es-redirect.yml | ||
| parameters: | ||
| oneESTemplateTag: ${{ parameters.oneESTemplateTag }} | ||
| stages: | ||
| - stage: Build | ||
| variables: | ||
| - template: /eng/pipelines/templates/variables/image.yml | ||
| jobs: | ||
| - template: /eng/pipelines/templates/jobs/ci.yml | ||
| parameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
| ${{ if eq(parameters.ServiceDirectory, 'template') }}: | ||
| TestPipeline: true | ||
| TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} | ||
| BuildDocs: ${{ parameters.BuildDocs }} | ||
| TestProxy: ${{ parameters.TestProxy }} | ||
| GenerateApiReviewForManualOnly: ${{ parameters.GenerateApiReviewForManualOnly }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| parameters: | ||
| - name: Toolchain | ||
| type: string | ||
| default: stable | ||
|
|
||
| steps: | ||
| - template: /eng/pipelines/templates/steps/use-rust.yml@self | ||
| parameters: | ||
| Toolchain: ${{ parameters.Toolchain }} | ||
|
|
||
| - pwsh: | | ||
| . ./eng/common/scripts/Helpers/CommandInvocation-Helpers.ps1 | ||
|
hallipr marked this conversation as resolved.
|
||
|
|
||
| $env:RUSTDOCFLAGS = "-D warnings" | ||
| $env:RUSTFLAGS = "-Dwarnings" | ||
|
|
||
| Invoke-LoggedCommand "cargo +$(Toolchain) check -p azure_core --no-default-features" | ||
| Invoke-LoggedCommand "cargo +$(Toolchain) fmt --all -- --check" | ||
| Invoke-LoggedCommand "cargo +$(Toolchain) clippy --all" | ||
| Invoke-LoggedCommand "cargo +$(Toolchain) doc --all --no-deps" | ||
| displayName: "Run source analysis" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.