Skip to content

Commit

Permalink
chore: move build steps into build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hcoona committed Sep 20, 2022
1 parent 8546e77 commit 2337486
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 56 deletions.
57 changes: 57 additions & 0 deletions .azure-pipelines/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
steps:
- checkout: self
clean: true
persistCredentials: true

# Checkout Git-LFS if necessary in the future.
# Note that we need to save Git-LFS bandwidth so currently we disabled it.
# Consider to use a separate Git-LFS storage than the one in GitHub.
- powershell: |
git lfs ls-files
displayName: "List Git-LFS files"

- task: UseDotNet@2
displayName: 'Install DotNet SDK'
inputs:
useGlobalJson: true

- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- script: nbgv cloud
displayName: Set Version

- task: Cache@2
displayName: 'Restore nuget cache'
inputs:
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json,!**/bin/**,!**/obj/**'
restoreKeys: |
nuget | "$(Agent.OS)"
nuget
path: '$(NUGET_PACKAGES)'
cacheHitVar: 'CACHE_RESTORED'

- task: DotNetCoreCLI@2
displayName: 'Build projects'
inputs:
command: 'build'
projects: 'dirs.proj'
arguments: '-c $(buildConfiguration)'

- task: DotNetCoreCLI@2
displayName: 'Test projects'
inputs:
command: 'test'
projects: 'dirs.proj'
arguments: '--no-restore --no-build -c $(buildConfiguration) --collect "Code coverage"'
publishTestResults: $(isWindows)

- task: PublishPipelineArtifact@1
displayName: 'Publish artifacts'
inputs:
targetPath: $(System.DefaultWorkingDirectory)/artifacts
artifactName: OneDotNet-$(osSuffix)
57 changes: 1 addition & 56 deletions .azure-pipelines/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,59 +22,4 @@ variables:
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages

steps:
- checkout: self
clean: true
persistCredentials: true

# Checkout Git-LFS if necessary in the future.
# Note that we need to save Git-LFS bandwidth so currently we disabled it.
# Consider to use a separate Git-LFS storage than the one in GitHub.
- powershell: |
git lfs ls-files
displayName: "List Git-LFS files"

- task: UseDotNet@2
displayName: 'Install DotNet SDK'
inputs:
useGlobalJson: true

- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- script: nbgv cloud
displayName: Set Version

- task: Cache@2
displayName: 'Restore nuget cache'
inputs:
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json,!**/bin/**,!**/obj/**'
restoreKeys: |
nuget | "$(Agent.OS)"
nuget
path: '$(NUGET_PACKAGES)'
cacheHitVar: 'CACHE_RESTORED'

- task: DotNetCoreCLI@2
displayName: 'Build projects'
inputs:
command: 'build'
projects: 'dirs.proj'
arguments: '-c $(buildConfiguration)'

- task: DotNetCoreCLI@2
displayName: 'Test projects'
inputs:
command: 'test'
projects: 'dirs.proj'
arguments: '--no-restore --no-build -c $(buildConfiguration) --collect "Code coverage"'
publishTestResults: $(isWindows)

- task: PublishPipelineArtifact@1
displayName: 'Publish artifacts'
inputs:
targetPath: $(System.DefaultWorkingDirectory)/artifacts
artifactName: OneDotNet-$(osSuffix)
- template: /.azure-pipelines/build.yml@self

0 comments on commit 2337486

Please sign in to comment.