Repository navigation
Make static CI a matrix #16397
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
Travis Plunk (TravisEz13)
merged 5 commits into
PowerShell:master
from
TravisEz13:make-static-matrix
Nov 9, 2021
Merged
Make static CI a matrix #16397
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| parameters: | ||
| - name: jobName | ||
| - name: taskName | ||
|
|
||
| jobs: | ||
| - job: ${{ parameters.jobName }} | ||
| displayName: Generate Markdown Matrix | ||
|
|
||
| pool: | ||
| vmImage: ubuntu-20.04 | ||
|
|
||
| variables: | ||
| - name: repoPath | ||
| value: $(Agent.BuildDirectory)/$(repoFolder) | ||
|
|
||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| path: $(repoFolder) | ||
|
|
||
| - powershell: | | ||
| $matrix = @{} | ||
| $matrix += @{ | ||
| 'root' = @{ | ||
| markdown_folder = "$(repoPath)" | ||
| markdown_recurse = $false | ||
| } | ||
| } | ||
| Get-ChildItem -path '$(repoPath)' -Directory | Foreach-Object { | ||
| $folder = $_ | ||
| $matrix += @{ | ||
| $_.Name = @{ | ||
| markdown_folder = $_.fullName | ||
| markdown_recurse = $true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| $matrixJson = $matrix | ConvertTo-Json -Compress | ||
| $variableName = "matrix" | ||
| $command = "vso[task.setvariable variable=$variableName;isoutput=true]$($matrixJson)" | ||
| Write-Verbose "sending command: '$command'" | ||
| Write-Host "##$command" | ||
| displayName: Create Matrix | ||
| condition: succeededOrFailed() | ||
| name: ${{ parameters.taskName }} |
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,63 @@ | ||
| parameters: | ||
| - name: matrix | ||
| - name: dependsOn | ||
|
|
||
| jobs: | ||
| - job: markdown | ||
| strategy: | ||
| matrix: ${{ parameters.matrix }} | ||
| maxParallel: 5 | ||
|
|
||
| displayName: Markdown Link Verification | ||
|
|
||
| dependsOn: ${{ parameters.dependsOn }} | ||
|
|
||
| pool: | ||
| vmImage: ubuntu-20.04 | ||
|
|
||
| variables: | ||
| - name: repoPath | ||
| value: $(Agent.BuildDirectory)/$(repoFolder) | ||
| - name: YARN_CACHE_FOLDER | ||
| value: $(Pipeline.Workspace)/.yarn | ||
| - name: YARN_GLOBAL_CACHE_FOLDER | ||
| value: $(Pipeline.Workspace)/.yarn-global | ||
|
|
||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| path: $(repoFolder) | ||
|
|
||
| - checkout: ComplianceRepo | ||
|
|
||
| - task: Cache@2 | ||
| inputs: | ||
| key: '"markdown-link-check" | "$(Agent.OS)" | $(repoPath)/test/common/markdown-link/markdown-link.tests.ps1' | ||
| path: $(YARN_GLOBAL_CACHE_FOLDER) | ||
| displayName: Cache Yarn packages | ||
|
|
||
| - powershell: | | ||
| Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99 | ||
| displayName: Install Pester | ||
|
|
||
| - bash: | | ||
| curl -o- --progress-bar -L https://yarnpkg.com/install.sh | bash | ||
| displayName: Bootstrap Yarn | ||
|
|
||
| - bash: | | ||
| yarn config set global-folder "$(YARN_GLOBAL_CACHE_FOLDER)" | ||
| displayName: Set Yarn global cache folder | ||
|
|
||
| - ${{ if not(contains(variables['SYSTEM.COLLECTIONURI'],'mscodehub')) }}: | ||
| - pwsh: | | ||
| Import-module ./build.psm1 | ||
| $path = Join-Path -Path $pwd -ChildPath './commonTestResults.xml' | ||
| $results = invoke-pester -Script ./test/common/markdown-link -OutputFile $path -OutputFormat NUnitXml -PassThru | ||
| Write-Host "##vso[results.publish type=NUnit;mergeResults=true;runTitle=Markdown Link;publishRunAttachments=true;resultFiles=$path;]" | ||
| if($results.TotalCount -eq 0 -or $results.FailedCount -gt 0) | ||
| { | ||
| throw "Markdown tests failed" | ||
| } | ||
| displayName: Run Markdown Link Tests | ||
| condition: succeededOrFailed() | ||
| workingDirectory: '$(repoPath)' |
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,56 @@ | ||
| jobs: | ||
| - job: markdown | ||
| displayName: Markdown Spelling | ||
|
|
||
| pool: | ||
| vmImage: ubuntu-20.04 | ||
|
|
||
| variables: | ||
| - name: repoPath | ||
| value: $(Agent.BuildDirectory)/$(repoFolder) | ||
|
|
||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| path: $(repoFolder) | ||
|
|
||
| - checkout: ComplianceRepo | ||
|
|
||
| - powershell: | | ||
| Get-ChildItem -Path env: | ||
| displayName: Capture Environment | ||
| condition: succeededOrFailed() | ||
|
|
||
| - bash: | | ||
| curl -o- --progress-bar -L https://yarnpkg.com/install.sh | bash | ||
| displayName: Bootstrap Yarn | ||
| condition: succeededOrFailed() | ||
|
|
||
| - bash: | | ||
| sudo yarn global add markdown-spellcheck@0.11.0 | ||
| displayName: Install mdspell | ||
| condition: succeededOrFailed() | ||
|
|
||
| - bash: | | ||
| mdspell '**/*.md' '!**/Pester/**/*.md' '!**/dotnet-tools/**/*.md' --ignore-numbers --ignore-acronyms --report --en-us; | ||
| displayName: Test Spelling in Markdown | ||
| condition: succeededOrFailed() | ||
| workingDirectory: '$(repoPath)' | ||
|
|
||
| - ${{ if not(contains(variables['SYSTEM.COLLECTIONURI'],'mscodehub')) }}: | ||
| - pwsh: | | ||
| Import-module ./build.psm1 | ||
| $path = Join-Path -Path $pwd -ChildPath './commonTestResults.xml' | ||
| $results = invoke-pester -Script ./test/common/markdown-lint -OutputFile $path -OutputFormat NUnitXml -PassThru | ||
| Write-Host "##vso[results.publish type=NUnit;mergeResults=true;runTitle=Markdown Lint;publishRunAttachments=true;resultFiles=$path;]" | ||
| if($results.TotalCount -eq 0 -or $results.FailedCount -gt 0) | ||
| { | ||
| throw "Markdown tests failed" | ||
| } | ||
| displayName: Run Markdown Lint Tests | ||
| condition: succeededOrFailed() | ||
| workingDirectory: '$(repoPath)' | ||
|
|
||
| - template: dailyBuildCompliance.yml@ComplianceRepo | ||
| parameters: | ||
| sourceScanPath: '$(repoPath)' |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.