-
Notifications
You must be signed in to change notification settings - Fork 437
[CI Environment] Added automation to update the Static Validation Tests documentation #2591
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 all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bef835a
Updated tests
AlexanderSehr 2d45c12
Updated tests & removed redundancy
AlexanderSehr 61b42d9
Added platform pipelines to keep the static test documentation automa…
AlexanderSehr be33d0e
Changed title
AlexanderSehr 683dfa6
Disabled condition for testing
AlexanderSehr 5e447d7
Push updated API Specs file
8553d09
Introduced section header
AlexanderSehr bc26c90
Replaced task type
AlexanderSehr 1d512f6
Re-enabled conditions
AlexanderSehr 3caaf86
Fallback of Wiki to re-enable testing
AlexanderSehr 7a15f88
Push updated API Specs file
6e760e2
Introduced display names
AlexanderSehr 6df1ebd
Update to latest
AlexanderSehr 7e823fa
Update .github/workflows/platform.updateStaticTestDocs.yml
AlexanderSehr 2aaa168
Update .azuredevops/platformPipelines/platform.updateStaticTestDocs.yml
AlexanderSehr 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
67 changes: 67 additions & 0 deletions
67
.azuredevops/platformPipelines/platform.updateStaticTestDocs.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,67 @@ | ||
| name: ".Platform - Update Static Test Documentation" | ||
|
|
||
| pr: none | ||
|
|
||
| trigger: | ||
| batch: true | ||
| branches: | ||
| include: | ||
| - main | ||
| paths: | ||
| include: | ||
| - .azuredevops/platformPipelines/platform.updateStaticTestDocs.yml | ||
| - 'utilities/pipelines/staticValidation/module.tests.ps1' | ||
AlexanderSehr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - utilities/tools/platform/Set-StaticTestDocumentation.ps1 | ||
|
|
||
| variables: | ||
| - template: "../../settings.yml" | ||
| - name: pipelinePrincipalGitUserName | ||
| value: "CARMLPipelinePrincipal" | ||
| - name: pipelinePrincipalGitUserEmail | ||
| value: "CARML@noreply.github.com" | ||
|
|
||
| jobs: | ||
| - job: Update_Static_Test_Docs | ||
| displayName: Update Static Tests Documentation | ||
| pool: | ||
| ${{ if ne(variables.vmImage, '') }}: | ||
| vmImage: ${{ variables.vmImage }} | ||
| ${{ if ne(variables.poolName, '') }}: | ||
| name: ${{ variables.poolName }} | ||
| steps: | ||
| - checkout: self | ||
| persistCredentials: true | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: "Update file" | ||
| inputs: | ||
| targetType: inline | ||
| pwsh: true | ||
| script: | | ||
| # Load used functions | ||
| . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'tools' 'platform' 'Set-StaticTestDocumentation.ps1') | ||
|
|
||
| $functionInput = @{ | ||
| TestFilePath = Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'staticValidation' 'module.tests.ps1' | ||
| WikiFilePath = Join-Path '$(System.DefaultWorkingDirectory)' 'docs' 'wiki' 'The CI environment - Static validation.md' | ||
| } | ||
|
|
||
| Write-Verbose "Invoke task with" -Verbose | ||
| Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose | ||
|
|
||
| Set-StaticTestDocumentation @functionInput -Verbose | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: "Push changes" | ||
| inputs: | ||
| targetType: inline | ||
| pwsh: true | ||
| script: | | ||
| git config --global user.email '$(pipelinePrincipalGitUserEmail)' | ||
| git config --global user.name '$(pipelinePrincipalGitUserName)' | ||
|
|
||
| git add . | ||
| git status | ||
| git commit -m 'Push updated API Specs file' | ||
| git pull $(Build.Repository.Uri) HEAD:$(Build.SourceBranch) | ||
| git push $(Build.Repository.Uri) HEAD:$(Build.SourceBranch) | ||
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,55 @@ | ||
| name: ".Platform: Update Static Test Documentation" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/workflows/platform.updateStaticTestDocs.yml' | ||
| - 'utilities/pipelines/staticValidation/module.tests.ps1' | ||
AlexanderSehr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - utilities/tools/platform/Set-StaticTestDocumentation.ps1 | ||
|
|
||
| env: | ||
| pipelinePrincipalGitUserName: "CARMLPipelinePrincipal" | ||
| pipelinePrincipalGitUserEmail: "CARML@noreply.github.com" | ||
|
|
||
| jobs: | ||
| job_update_static_test_docs: | ||
| name: "Update file" | ||
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | ||
| runs-on: ubuntu-20.04 | ||
| steps: | ||
| - name: "Checkout" | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: "${{ secrets.PLATFORM_REPO_UPDATE_PAT }}" # Sets general GIT credentials up | ||
|
|
||
| - name: "Update file" | ||
| shell: pwsh | ||
| run: | | ||
| # Load used functions | ||
| . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'tools' 'platform' 'Set-StaticTestDocumentation.ps1') | ||
|
|
||
| $functionInput = @{ | ||
| TestFilePath = Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'staticValidation' 'module.tests.ps1' | ||
| WikiFilePath = Join-Path $env:GITHUB_WORKSPACE 'docs' 'wiki' 'The CI environment - Static validation.md' | ||
| } | ||
|
|
||
| Write-Verbose "Invoke task with" -Verbose | ||
| Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose | ||
|
|
||
| Set-StaticTestDocumentation @functionInput -Verbose | ||
|
|
||
| - name: "Push changes" | ||
| shell: pwsh | ||
| run: | | ||
| git config --global user.email '${{ env.pipelinePrincipalGitUserEmail }}' | ||
| git config --global user.name '${{ env.pipelinePrincipalGitUserName }}' | ||
|
|
||
| git pull | ||
| git status | ||
| git add . | ||
| git commit -m 'Push updated API Specs file' | ||
| git push | ||
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
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.