Skip to content

Commit

Permalink
Configure CI (no. 87)
Browse files Browse the repository at this point in the history
  • Loading branch information
cafour committed Apr 23, 2021
1 parent 289c9bb commit 3934678
Showing 1 changed file with 160 additions and 141 deletions.
301 changes: 160 additions & 141 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,163 +10,182 @@ variables:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

jobs:
- job: crossplatformBuild
displayName: Build cross-platform projects (Linux)
pool:
name: AdamovoPool
demands: Agent.OS -equals Linux
container: docker-reg.riganti.cz/dotvvm-ci:linux
workspace:
clean: all
steps:
- task: Cache@2
inputs:
key: '"npm" | "$(Agent.OS)" | src/DotVVM.Framework/package.json'
path: $(DOTVVM_ROOT)/.npm
restoreKeys: '"npm" | "$(Agent.OS)"'
- script: npm ci --cache $(DOTVVM_ROOT)/.npm --prefer-offline
workingDirectory: src/DotVVM.Framework
- script: npm run build
workingDirectory: src/DotVVM.Framework
- task: Cache@2
inputs:
key: '"nuget" | "$(Agent.OS)" | **/packages.lock.json'
path: $(DOTVVM_ROOT)/.nuget
- task: DotNetCoreCLI@2
inputs:
command: restore
projects: src/Crossplatform.sln
packagesDirectory: $(DOTVVM_ROOT)/.nuget
- task: DotNetCoreCLI@2
inputs:
command: build
projects: src/Crossplatform.sln
arguments: --no-restore --configuration $(BUILD_CONFIGURATION)
- publish: $(DOTVVM_ROOT)/artifacts
name: crossplatformBuild
# - job: crossplatformBuild
# displayName: Build cross-platform projects (Linux)
# pool:
# name: AdamovoPool
# demands: Agent.OS -equals Linux
# container: docker-reg.riganti.cz/dotvvm-ci:linux
# workspace:
# clean: all
# steps:
# - task: Cache@2
# inputs:
# key: '"npm" | "$(Agent.OS)" | src/DotVVM.Framework/package.json'
# path: $(DOTVVM_ROOT)/.npm
# restoreKeys: '"npm" | "$(Agent.OS)"'
# - script: npm ci --cache $(DOTVVM_ROOT)/.npm --prefer-offline
# workingDirectory: src/DotVVM.Framework
# - script: npm run build
# workingDirectory: src/DotVVM.Framework
# - task: Cache@2
# inputs:
# key: '"nuget" | "$(Agent.OS)" | **/packages.lock.json'
# path: $(DOTVVM_ROOT)/.nuget
# - task: DotNetCoreCLI@2
# inputs:
# command: restore
# projects: src/Crossplatform.sln
# packagesDirectory: $(DOTVVM_ROOT)/.nuget
# - task: DotNetCoreCLI@2
# inputs:
# command: build
# projects: src/Crossplatform.sln
# arguments: --no-restore --configuration $(BUILD_CONFIGURATION)
# - publish: $(DOTVVM_ROOT)/artifacts
# name: crossplatformBuild

- job: unitTestsCrossplatform
displayName: Run cross-platform unit tests (Linux)
pool:
name: AdamovoPool
demands: Agent.OS -equals Linux
container: docker-reg.riganti.cz/dotvvm-ci:linux
dependsOn: crossplatformBuild
workspace:
clean: all
steps:
- task: DownloadPipelineArtifact@2
inputs:
source: current
artifact: crossplatformBuild
path: $(DOTVVM_ROOT)/artifacts
- task: Cache@2
inputs:
key: '"nuget" | "$(Agent.OS)" | **/packages.lock.json'
path: $(DOTVVM_ROOT)/.nuget
- task: DotNetCoreCLI@2
inputs:
command: test
projects: src/DotVVM.Framework.Tests.Common
arguments: --no-build --configuration $(BUILD_CONFIGURATION)
publishTestResults: true
# - job: unitTestsCrossplatform
# displayName: Run cross-platform unit tests (Linux)
# pool:
# name: AdamovoPool
# demands: Agent.OS -equals Linux
# container: docker-reg.riganti.cz/dotvvm-ci:linux
# dependsOn: crossplatformBuild
# workspace:
# clean: all
# steps:
# - task: DownloadPipelineArtifact@2
# inputs:
# source: current
# artifact: crossplatformBuild
# path: $(DOTVVM_ROOT)/artifacts
# - task: Cache@2
# inputs:
# key: '"nuget" | "$(Agent.OS)" | **/packages.lock.json'
# path: $(DOTVVM_ROOT)/.nuget
# - task: DotNetCoreCLI@2
# inputs:
# command: test
# projects: src/DotVVM.Framework.Tests.Common
# arguments: --no-build --configuration $(BUILD_CONFIGURATION)
# publishTestResults: true

- job: uiTestsCrossplatform
displayName: Run UI tests (Linux)
pool:
name: AdamovoPool
demands: Agent.OS -equals Linux
container: docker-reg.riganti.cz/dotvvm-ci:linux
dependsOn: crossplatformBuild
workspace:
clean: all
steps:
- download: current
artifact: crossplatformBuild
- script: mv $(Pipeline.Workspace)/crossplatformBuild $(DOTVVM_ROOT)/artifacts
- script: Xvfb $DISPLAY -screen 0 800x600x16 &
- task: Cache@2
inputs:
key: '"nuget" | "$(Agent.OS)" | **/packages.lock.json'
path: $(DOTVVM_ROOT)/.nuget
- script: find $(DOTVVM_ROOT)/artifacts -type f -exec chmod +rwx {} \;
- script: |
dotnet run --project src/DotVVM.Samples.BasicSamples.AspNetCoreLatest \
--no-build \
--configuration $(BUILD_CONFIGURATION) \
--urls http://localhost:16018/ &
- script: |
dotnet test src/DotVVM.Samples.Tests \
--no-build \
--configuration $(BUILD_CONFIGURATION) \
--logger trx \
--results-directory $(Agent.TempDirectory)
continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFormat: VSTest
testResultsFiles: $(Agent.TempDirectory)/**/*.trx
failTaskOnFailedTests: true
buildConfiguration: $(BUILD_CONFIGURATION)
# - job: uiTestsCrossplatform
# displayName: Run UI tests (Linux)
# pool:
# name: AdamovoPool
# demands: Agent.OS -equals Linux
# container: docker-reg.riganti.cz/dotvvm-ci:linux
# dependsOn: crossplatformBuild
# workspace:
# clean: all
# steps:
# - task: DownloadPipelineArtifact@2
# inputs:
# source: current
# artifact: crossplatformBuild
# path: $(DOTVVM_ROOT)/artifacts
# - script: Xvfb $DISPLAY -screen 0 800x600x16 &
# - task: Cache@2
# inputs:
# key: '"nuget" | "$(Agent.OS)" | **/packages.lock.json'
# path: $(DOTVVM_ROOT)/.nuget
# - script: find $(DOTVVM_ROOT)/artifacts -type f -exec chmod +rwx {} \;
# - script: |
# dotnet run --project src/DotVVM.Samples.BasicSamples.AspNetCoreLatest \
# --no-build \
# --configuration $(BUILD_CONFIGURATION) \
# --urls http://localhost:16018/ &
# - script: |
# dotnet test src/DotVVM.Samples.Tests \
# --no-build \
# --configuration $(BUILD_CONFIGURATION) \
# --logger trx \
# --results-directory $(Agent.TempDirectory)
# continueOnError: true
# - task: PublishTestResults@2
# inputs:
# testResultsFormat: VSTest
# testResultsFiles: $(Agent.TempDirectory)/**/*.trx
# failTaskOnFailedTests: true
# buildConfiguration: $(BUILD_CONFIGURATION)

- job: owinBuild
displayName: Build OWIN projects (Windows)
pool:
name: AdamovoPool
demands: Agent.OS -equals Windows_NT
workspace:
clean: all
steps:
- task: Cache@2
inputs:
key: '"npm" | "$(Agent.OS)" | src/DotVVM.Framework/package.json'
path: $(DOTVVM_ROOT)/.npm
restoreKeys: '"npm" | "$(Agent.OS)"'
- script: npm ci --cache $(DOTVVM_ROOT)/.npm --prefer-offline
workingDirectory: src/DotVVM.Framework
- script: npm run build
workingDirectory: src/DotVVM.Framework
- task: Cache@2
inputs:
key: '"nuget-owin" | "$(Agent.OS)" | **/packages.lock.json'
path: $(Build.SourcesDirectory)/src/packages
- task: NuGetCommand@2
inputs:
command: restore
restoreSolution: src/Windows.sln
feedsToUse: config
nugetConfigPath: src/NuGet.config
- task: MSBuild@1
inputs:
solution: src/Windows.sln
configuration: $(BUILD_CONFIGURATION)
msbuildArguments: >
/p:DeployOnBuild=true
/p:PublishProfile=$(Build.SourcesDirectory)/ci/windows/GenericPublish.pubxml
- publish: $(DOTVVM_ROOT)/artifacts
name: owinBuild
# - job: owinBuild
# displayName: Build OWIN projects (Windows)
# pool:
# name: AdamovoPool
# demands: Agent.OS -equals Windows_NT
# workspace:
# clean: all
# steps:
# - task: Cache@2
# inputs:
# key: '"npm" | "$(Agent.OS)" | src/DotVVM.Framework/package.json'
# path: $(DOTVVM_ROOT)/.npm
# restoreKeys: '"npm" | "$(Agent.OS)"'
# - script: npm ci --cache $(DOTVVM_ROOT)/.npm --prefer-offline
# workingDirectory: src/DotVVM.Framework
# - script: npm run build
# workingDirectory: src/DotVVM.Framework
# - task: Cache@2
# inputs:
# key: '"nuget-owin" | "$(Agent.OS)" | **/packages.lock.json'
# path: $(Build.SourcesDirectory)/src/packages
# - task: NuGetCommand@2
# inputs:
# command: restore
# restoreSolution: src/Windows.sln
# feedsToUse: config
# nugetConfigPath: src/NuGet.config
# - task: MSBuild@1
# inputs:
# solution: src/Windows.sln
# configuration: $(BUILD_CONFIGURATION)
# msbuildArguments: >
# /p:DeployOnBuild=true
# /p:PublishProfile=$(Build.SourcesDirectory)/ci/windows/GenericPublish.pubxml
# - publish: $(DOTVVM_ROOT)/artifacts
# name: owinBuild

- job: uiTestsOwin
displayName: Run UI tests (Windows)
pool:
name: AdamovoPool
demands: Agent.OS -equals Windows_NT
container: docker-reg.riganti.cz/dotvvm-ci:windows
dependsOn: owinBuild
# dependsOn: owinBuild
workspace:
clean: all
steps:
- download: current
artifact: owinBuild
# - download: current
# artifact: owinBuild
# - task: DownloadPipelineArtifact@2
# inputs:
# source: 'specific'
# project: 'DotVVM Public'
# pipeline: 'CI'
# runVersion: specific
# runId: '110124'
# artifact: 'owinBuild'
# source: current
# artifact: owinBuild
# path: $(DOTVVM_ROOT)/artifacts
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: DotVVM Public
pipeline: CI
runVersion: specific
runId: '110502'
artifact: owinBuild
path: $(DOTVVM_ROOT)/artifacts
- powershell: |
Copy-Item -Recurse `
$(DOTVVM_ROOT)/artifacts/DotVVM.Samples.BasicSamples.Owin `
C:/inetpub/wwwroot
- powershell: |
Copy-Item -Recurse `
$(DOTVVM_ROOT)/artifacts/DotVVM.Samples.BasicSamples.Api.Owin `
C:/inetpub/wwwroot
- powershell: |
Copy-Item -Recurse `
$(Build.BinariesDirectory)/src/DotVVM.Samples.Common `
C:/inetpub/wwwroot
- powershell: |
dotnet test src/DotVVM.Samples.Tests `
--configuration $(BUILD_CONFIGURATION) `
Expand Down

0 comments on commit 3934678

Please sign in to comment.