Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ trim_trailing_whitespace = true
[*.json]
indent_size = 2

[*.ps1]
indent_size = 2

[*.rs]
end_of_line = lf

Expand Down
8 changes: 7 additions & 1 deletion .vscode/settings.json
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.
Comment thread
hallipr marked this conversation as resolved.
Outdated
"yaml.format.printWidth": 240
}
17 changes: 17 additions & 0 deletions eng/CredScanSuppression.json
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."
}
]
}
12 changes: 12 additions & 0 deletions eng/pipelines/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
trigger: none

pr:
branches:
include:
- feature/track2
Comment thread
hallipr marked this conversation as resolved.
Outdated

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
TestProxy: true
Comment thread
hallipr marked this conversation as resolved.
Outdated
TestTimeOutInMinutes: 120
114 changes: 114 additions & 0 deletions eng/pipelines/templates/jobs/ci.yml
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()
61 changes: 61 additions & 0 deletions eng/pipelines/templates/stages/1es-redirect.yml
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:
Comment thread
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 }}
38 changes: 38 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
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 }}
21 changes: 21 additions & 0 deletions eng/pipelines/templates/steps/analyze.yml
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
Comment thread
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"
Loading