From a42855a53bc287b3aa793bad5da10c82e38e6690 Mon Sep 17 00:00:00 2001 From: dmitrykurmanov Date: Wed, 25 Dec 2024 14:09:16 +0400 Subject: [PATCH] added legacy pipelines --- legacy-pipelines/accessibility-tests.yml | 396 ++++++++ legacy-pipelines/build-packages.yml | 902 +++++++++++++++++++ legacy-pipelines/visual-regression-tests.yml | 537 +++++++++++ 3 files changed, 1835 insertions(+) create mode 100644 legacy-pipelines/accessibility-tests.yml create mode 100644 legacy-pipelines/build-packages.yml create mode 100644 legacy-pipelines/visual-regression-tests.yml diff --git a/legacy-pipelines/accessibility-tests.yml b/legacy-pipelines/accessibility-tests.yml new file mode 100644 index 0000000000..846466035c --- /dev/null +++ b/legacy-pipelines/accessibility-tests.yml @@ -0,0 +1,396 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + + +trigger: + batch: true + branches: + include: + - legacy/1.12.15 + tags: + exclude: + - v*.*.* + +pool: + vmImage: 'windows-latest' + +jobs: +- job: Knockout + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + npm run build_knockout_prod + displayName: 'build prod' + + - script: | + npm run accessibility-tests:ci:knockout + displayName: 'Accessibility Tests' + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Knockout_AXE' + OverWrite: true + condition: always() + displayName: 'copy accessibility artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Knockout_AXE/' + ArtifactName: 'Library_Knockout_AXE' + publishLocation: 'Container' + condition: always() + displayName: 'publish accessibility artifacts' + +- job: React + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - powershell: | + npm run build_react_prod + npm run build_core + npm run build_react_ui + displayName: 'build prod' + + - script: | + npm run accessibility-tests:ci:react + displayName: 'Accessibility Tests' + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_React_AXE' + OverWrite: true + condition: always() + displayName: 'copy accessibility artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_React_AXE/' + ArtifactName: 'Library_React_AXE' + publishLocation: 'Container' + condition: always() + displayName: 'publish accessibility artifacts' + +- job: Vue + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + npm run build_vue_prod + displayName: 'build prod' + + - script: | + npm run accessibility-tests:ci:vue + displayName: 'Accessibility Tests' + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Vue_AXE' + OverWrite: true + condition: always() + displayName: 'copy accessibility artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Vue_AXE/' + ArtifactName: 'Library_Vue_AXE' + publishLocation: 'Container' + condition: always() + displayName: 'publish accessibility artifacts' + +- job: Angular + steps: + - checkout: self + persistCredentials: true + clean: true + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPMs + + - task: Npm@1 + displayName: 'NPM install root' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - powershell: | + npm run build_core + npm run build_i18n_dev + npm run build-plugins + displayName: "Build Core" + + - script: | + cd packages/survey-angular-ui + npm install + displayName: "NPM install packages/survey-angular-ui" + + - script: | + cd packages/survey-angular-ui + npm run build + displayName: "Build Angular" + + - script: | + cd packages/survey-angular-ui/example + npm install + displayName: "NPM install examples/angular-ui" + + - script: | + cd packages/survey-angular-ui + npm run build:example + displayName: "Build Angular Example" + + - script: | + npm run accessibility-tests:ci:angular + displayName: "run accessibility tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Angular_AXE' + OverWrite: true + condition: always() + displayName: 'copy accessibility artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Angular_AXE/' + ArtifactName: 'Library_Angular_AXE' + publishLocation: 'Container' + condition: always() + displayName: 'publish accessibility artifacts' + +- job: Vue3 + steps: + - checkout: self + persistCredentials: true + clean: true + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPMs + + - task: Npm@1 + displayName: 'NPM install root' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - powershell: | + npm run build_core + npm run build_i18n_dev + npm run build-plugins + displayName: "Build Core" + + - script: | + cd packages/survey-vue3-ui + npm install + displayName: "NPM install packages/survey-vue3-ui" + + - script: | + cd packages/survey-vue3-ui + npm run build + displayName: "Build Vue3" + + - script: | + cd packages/survey-vue3-ui/example + npm install + displayName: "NPM install Vue3 example" + + - script: | + cd packages/survey-vue3-ui/example + npm run build + displayName: "Build Vue3 Example" + + - script: | + npm run accessibility-tests:ci:vue3 + displayName: "run accessibility tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Vue3_AXE' + OverWrite: true + condition: always() + displayName: 'copy accessibility artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Vue3_AXE/' + ArtifactName: 'Library_Vue3_AXE' + publishLocation: 'Container' + condition: always() + displayName: 'publish accessibility artifacts' \ No newline at end of file diff --git a/legacy-pipelines/build-packages.yml b/legacy-pipelines/build-packages.yml new file mode 100644 index 0000000000..765ed297cd --- /dev/null +++ b/legacy-pipelines/build-packages.yml @@ -0,0 +1,902 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +resources: + repositories: + - repository: Service # The name used to reference this repository in the checkout step + type: github + endpoint: dmitrykurmanov:admin + name: surveyjs/service + - repository: EmptyRepo + type: github + endpoint: dmitrykurmanov:admin + name: surveyjs/azure-pipelines-repo-dont-remove-please + +variables: + npm_config_cache: $(Pipeline.Workspace)/.npm + + +trigger: + batch: true + branches: + include: + - legacy/1.12.15 + tags: + exclude: + - v*.*.* + +pool: + vmImage: ubuntu-latest + +jobs: + +- job: NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + +- job: CoreAngularJquery + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: Service + persistCredentials: true + clean: true + fetchDepth: 1 + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + displayName: "Build Core" + + # - script: | + # cd $(Build.SourcesDirectory)/survey-library + # npm run doc_gen + # displayName: "generate docs" + + # - task: CopyFiles@2 + # inputs: + # SourceFolder: "$(Build.SourcesDirectory)/survey-library/docs" + # Contents: | + # classes.json + # pmes.json + # surveyjs_definition.json + # TargetFolder: "$(Build.SourcesDirectory)/service/surveyjs.io/App_Data/DocsLibrary" + # OverWrite: true + # CleanTargetFolder: false + # displayName: "copy generated docs to the local surveyjs/service repo" + + # # read about the problem with git output ($env:GIT_REDIRECT_STDERR = '2>&1') : + # # https://github.com/microsoft/azure-pipelines-yaml/issues/248 + # # https://stackoverflow.com/questions/58485585/azure-pipeline-powershell-and-git-on-windows-server-2019-gives-error-in-output + # - powershell: | + # cd $(Build.SourcesDirectory)/service + # $env:GIT_REDIRECT_STDERR = '2>&1' + # git config --global user.email "kurmanov.work@gmail.com" + # git config --global user.name "dmitrykurmanov" + # git pull origin + # git fetch origin --tags --force + # git add surveyjs.io/App_Data/DocsLibrary + # git commit -m "updated survey-library docs [azurepipelines skip]" + # git pull origin + # git push origin + # displayName: "git surveyjs/service push updated docs" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_angular + displayName: "Build Angular" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_jquery + displayName: "Build jQuery" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-core" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-core" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-angular" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-angular" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-jquery" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-jquery" + + #trigger next build via the artifact file 'version.txt' + - task: CopyFiles@2 + inputs: + contents: "version.txt" + targetFolder: $(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild + displayName: "copy version file to Build.ArtifactStagingDirectory" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildCoreAngularJquery" + publishLocation: "Container" + +- job: Knockout + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_knockout + displayName: "Build Knockout" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + npm run build_knockout_ui + displayName: "Build Knockout UI" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run test:postcss + displayName: "check postcss compatibility" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testsingle + displayName: "run unit tests" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testcafe:ko + displayName: "run functional tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-knockout" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-knockout" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-knockout-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-knockout-ui" + + #trigger next build via the artifact file 'version.txt' + - task: CopyFiles@2 + inputs: + contents: "version.txt" + targetFolder: $(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild + displayName: "copy version file to Build.ArtifactStagingDirectory" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildKnockout" + publishLocation: "Container" + +- job: React + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_react + displayName: "Build React" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + npm run build_react_ui + displayName: "Build React UI" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testcafe:react + displayName: "run functional tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-react" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-react" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-react-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-react-ui" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildReact" + publishLocation: "Container" + +- job: Vue + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_vue + displayName: "Build Vue" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + npm run build_vue_ui + displayName: "Build Vue UI" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testcafe:vue + displayName: "Vue functional tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-vue" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-vue" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-vue-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-vue-ui" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildVue" + publishLocation: "Container" + +- job: Angular + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPMs + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + + - task: Npm@1 + displayName: 'NPM install root' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + displayName: "Build Core" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-angular-ui + npm install + displayName: "NPM install packages/survey-angular-ui" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-angular-ui + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-angular-ui + npm run build + displayName: "Build Angular" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-angular-ui/example + npm install + displayName: "NPM install examples/angular-ui" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-angular-ui + npm run build:example + displayName: "Build Angular Example" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-angular-ui + npm run test:single + displayName: "run unit and markup tests" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testcafe:ci:angular + displayName: "run functional tests" + + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-angular-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-angular-ui" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildAngular" + publishLocation: "Container" + +- job: Vue3 + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPMs + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + + - task: Npm@1 + displayName: 'NPM install root' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + displayName: "Build Core" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui + npm install + displayName: "NPM install packages/survey-vue3-ui" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui + npm run build + displayName: "Build Vue3" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui/example + npm install + displayName: "NPM install survey-vue3-ui/example" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui/example + npm run build + displayName: "Build Vue3 Example" + + - script: | + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui + npm run test:single + displayName: "run unit and markup tests" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testcafe:ci:vue3 + displayName: "run functional tests" + + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-vue3-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-vue3-ui" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildVue3" + publishLocation: "Container" + +- job: SurveyUI_and_CSSFrameworks + dependsOn: + - NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + # setup next release version + - task: DownloadBuildArtifacts@0 + inputs: + buildType: "specific" + project: "44ed9012-3b38-49f8-a488-0e764469a04f" + pipeline: "100" + buildVersionToDownload: "latest" + downloadType: "single" + artifactName: "ReleaseVersionFile" + downloadPath: "$(System.ArtifactsDirectory)" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(System.ArtifactsDirectory)/ReleaseVersionFile/" + Contents: "version.txt" + TargetFolder: "$(Build.SourcesDirectory)/" + OverWrite: true + displayName: "Copy Build Artifact - SurveyJSVersion File" + + - powershell: | + $version = Get-Content $(Build.SourcesDirectory)/version.txt + Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version" + displayName: "setup SurveyJSVersion variable from SurveyJSVersionFile" + ########################################################################## + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run release -- --release-as $(SurveyJSVersion) + git status + displayName: "npm run release" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_core + npm run build_i18n + npm run build-plugins + displayName: "Build Core" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run build_js_ui + displayName: "Build survey-js-ui" + + - script: | + cd $(Build.SourcesDirectory)/survey-library + npm run testcafe:survey-js-ui:ci + displayName: "run functional tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-js-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-js-ui" + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/" + ArtifactName: "SurveyJSLibraryBuildSurveyUI" + publishLocation: "Container" diff --git a/legacy-pipelines/visual-regression-tests.yml b/legacy-pipelines/visual-regression-tests.yml new file mode 100644 index 0000000000..1bbdaae8fb --- /dev/null +++ b/legacy-pipelines/visual-regression-tests.yml @@ -0,0 +1,537 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + + +trigger: + batch: true + branches: + include: + - legacy/1.12.15 + tags: + exclude: + - v*.*.* + +pool: + vmImage: 'windows-latest' + +jobs: +- job: Knockout + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + npm run build_knockout_prod + displayName: 'build prod' + + - script: | + npm run visual-regression-tests:ci:knockout + displayName: 'Visual Regression Tests' + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Knockout_VRT' + OverWrite: true + condition: always() + displayName: 'copy vrt artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Knockout_VRT/' + ArtifactName: 'Library_Knockout_VRT' + publishLocation: 'Container' + condition: always() + displayName: 'publish vrt artifacts' + +- job: React + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - powershell: | + npm run build_react_prod + npm run build_core + npm run build_i18n + npm run build-plugins + npm run build_react_ui + displayName: 'build prod' + + - script: | + npm run visual-regression-tests:ci:react + displayName: 'Visual Regression Tests' + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_React_VRT' + OverWrite: true + condition: always() + displayName: 'copy vrt artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_React_VRT/' + ArtifactName: 'Library_React_VRT' + publishLocation: 'Container' + condition: always() + displayName: 'publish vrt artifacts' + +- job: Vue + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + + - script: | + npm run build_vue_prod + displayName: 'build prod' + + - script: | + npm run visual-regression-tests:ci:vue + displayName: 'Visual Regression Tests' + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Vue_VRT' + OverWrite: true + condition: always() + displayName: 'copy vrt artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Vue_VRT/' + ArtifactName: 'Library_Vue_VRT' + publishLocation: 'Container' + condition: always() + displayName: 'publish vrt artifacts' + +- job: Angular + steps: + - checkout: self + persistCredentials: true + clean: true + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPMs + + - task: Npm@1 + displayName: 'NPM install root' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - powershell: | + npm run build_core + npm run build_i18n_dev + npm run build-plugins + displayName: "Build Core" + + - script: | + cd packages/survey-angular-ui + npm install + displayName: "NPM install packages/survey-angular-ui" + + - script: | + cd packages/survey-angular-ui + npm run build + displayName: "Build Angular" + + - script: | + cd packages/survey-angular-ui/example + npm install + displayName: "NPM install examples/angular-ui" + + - script: | + cd packages/survey-angular-ui + npm run build:example + displayName: "Build Angular Example" + + - script: | + npm run visual-regression-tests:ci:angular + displayName: "run vrt tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Angular_VRT' + OverWrite: true + condition: always() + displayName: 'copy vrt artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Angular_VRT/' + ArtifactName: 'Library_Angular_VRT' + publishLocation: 'Container' + condition: always() + displayName: 'publish vrt artifacts' + +- job: Vue3 + steps: + - checkout: self + persistCredentials: true + clean: true + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: "16.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPMs + + - task: Npm@1 + displayName: 'NPM install root' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - powershell: | + npm run build_core + npm run build_i18n_dev + npm run build-plugins + displayName: "Build Core" + + - script: | + cd packages/survey-vue3-ui + npm install + displayName: "NPM install packages/survey-vue3-ui" + + - script: | + cd packages/survey-vue3-ui + npm run build + displayName: "Build Vue3" + + - script: | + cd packages/survey-vue3-ui/example + npm install + displayName: "NPM install Vue3 example" + + - script: | + cd packages/survey-vue3-ui/example + npm run build + displayName: "Build Vue3 Example" + + - script: | + npm run visual-regression-tests:ci:vue3 + displayName: "run vrt tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_Vue3_VRT' + OverWrite: true + condition: always() + displayName: 'copy vrt artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_Vue3_VRT/' + ArtifactName: 'Library_Vue3_VRT' + publishLocation: 'Container' + condition: always() + displayName: 'publish vrt artifacts' + +# - job: JqueryUI +# steps: +# - checkout: self + +# - task: PowerShell@2 +# displayName: 'update Google Chrome to latest' +# inputs: +# targetType: 'inline' +# script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + +# - task: NodeTool@0 +# inputs: +# versionSpec: '16.x' +# displayName: 'Install Node.js' + +# - task: CopyFiles@2 +# inputs: +# SourceFolder: "$(Build.SourcesDirectory)/" +# Contents: "package.json" +# TargetFolder: "$(Build.SourcesDirectory)/Temp/" +# OverWrite: true +# displayName: "Copy package.json for cache key" +# - task: Cache@2 +# inputs: +# key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' +# path: $(Build.SourcesDirectory)/node_modules +# cacheHitVar: NPM_CACHE_RESTORED +# displayName: Cache NPM + +# - task: Npm@1 +# displayName: 'NPM install' +# inputs: +# command: install +# verbose: false +# condition: ne(variables.NPM_CACHE_RESTORED, 'true') + +# - script: | +# npm run build_core +# npm run build_i18n +# npm run build-plugins +# displayName: "Build Core" + +# - script: | +# npm run build_jquery_ui_prod +# displayName: "Build jquery-ui" + +# - script: | +# npm run vrt:jquery-ui:ci +# displayName: "Visual Regression Tests" + +# - task: CopyFiles@2 +# inputs: +# SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' +# Contents: '**' +# TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_JqueryUI_VRT' +# OverWrite: true +# condition: always() +# displayName: 'copy vrt artifacts' + +# - task: PublishBuildArtifacts@1 +# inputs: +# PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_JqueryUI_VRT/' +# ArtifactName: 'Library_JqueryUI_VRT' +# publishLocation: 'Container' +# condition: always() +# displayName: 'publish vrt artifacts' + +- job: SurveyUI_and_CSSFrameworks + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'update Google Chrome to latest' + inputs: + targetType: 'inline' + script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer' + + - task: NodeTool@0 + inputs: + versionSpec: '16.x' + displayName: 'Install Node.js' + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - script: | + npx puppeteer browsers install chrome + displayName: "install chrome" + + - script: | + npm run build_core + npm run build_i18n + npm run build-plugins + displayName: "Build Core" + + - script: | + npm run build_js_ui_prod + displayName: "Build survey-js-ui" + + - script: | + npm run vrt:survey-js-ui:ci + displayName: "Visual Regression Tests" + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)/visualRegressionTests' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/Library_SurveyUI_VRT' + OverWrite: true + condition: always() + displayName: 'copy vrt artifacts' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/Library_SurveyUI_VRT/' + ArtifactName: 'Library_SurveyUI_VRT' + publishLocation: 'Container' + condition: always() + displayName: 'publish vrt artifacts'