Created
November 19, 2020 22:23
-
-
Save ephos/006789d0a700d14b0c69722c193cebc6 to your computer and use it in GitHub Desktop.
This file contains 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
trigger: | |
paths: | |
exclude: | |
- azure-pipelines.yml | |
- .gitignore | |
- LICENSE | |
- ReadMe.md | |
- images/* | |
branches: | |
include: | |
- main | |
variables: | |
- name: ModuleName | |
value: 'PSCOVID-19' | |
pool: | |
vmImage: 'windows-latest' | |
jobs: | |
- job: PowerShell_CICD | |
workspace: | |
clean: all | |
steps: | |
- task: Pester@8 | |
displayName: 'Run Pester Tests' | |
inputs: | |
scriptFolder: '$(Build.SourcesDirectory)\tests\*' | |
resultsFile: '$(Build.ArtifactStagingDirectory)\Test-Pester.XML' | |
run32Bit: False | |
- task: PublishTestResults@2 | |
displayName: 'Publish Test Results' | |
inputs: | |
testResultsFormat: 'NUnit' | |
testResultsFiles: '**/TEST-*.xml' | |
searchFolder: '$(Build.ArtifactStagingDirectory)' | |
condition: succeededOrFailed() | |
steps: | |
- task: CopyFiles@2 | |
displayName: 'Copy Module Source to Staging' | |
inputs: | |
SourceFolder: '$(Build.SourcesDirectory)\src\' | |
Contents: '**' | |
TargetFolder: '$(Build.ArtifactStagingDirectory)\$(ModuleName)\' | |
CleanTargetFolder: true | |
OverWrite: true | |
- task: PublishBuildArtifacts@1 | |
inputs: | |
PathtoPublish: '$(Build.ArtifactStagingDirectory)\$(ModuleName)' | |
ArtifactName: '$(ModuleName)' | |
publishLocation: 'Container' | |
- task: PSGalleryPackager@0 | |
inputs: | |
apiKey: '$(PSGallery)' | |
path: '$(Build.ArtifactStagingDirectory)\$(ModuleName)' | |
condition: and(succeeded('PullRequest'), ne(variables['Build.Reason'], 'PullRequest')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment