Radarr/azure-pipelines.yml

971 lines
34 KiB
YAML
Raw Normal View History

# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
variables:
outputFolder: './_output'
artifactsFolder: './_artifacts'
testsFolder: './_tests'
2021-05-23 16:42:58 +00:00
majorVersion: '4.0.0'
minorVersion: $[counter('minorVersion', 2000)]
radarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
2020-04-28 05:26:05 +00:00
sentryOrg: 'servarr'
sentryUrl: 'https://sentry.servarr.com'
2021-04-12 14:17:11 +00:00
dotnetVersion: '5.0.202'
2020-08-21 02:25:50 +00:00
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
trigger:
branches:
include:
- develop
2020-09-27 02:03:14 +00:00
- master
pr:
branches:
include:
- develop
paths:
exclude:
- src/NzbDrone.Core/Localization/Core
stages:
- stage: Setup
displayName: Setup
jobs:
- job:
displayName: Build Variables
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
steps:
# Set the build name properly. The 'name' property won't recursively expand so hack here:
- bash: echo "##vso[build.updatebuildnumber]$RADARRVERSION"
displayName: Set Build Name
- bash: |
if [[ $BUILD_REASON == "PullRequest" ]]; then
2020-09-27 02:03:14 +00:00
git diff origin/develop...HEAD --name-only | grep -E "^(src/|azure-pipelines.yml)"
echo $? > not_backend_update
else
echo 0 > not_backend_update
fi
cat not_backend_update
displayName: Check for Backend File Changes
- publish: not_backend_update
artifact: not_backend_update
displayName: Publish update type
- stage: Build_Backend
displayName: Build Backend
dependsOn: Setup
jobs:
- job: Backend
strategy:
matrix:
Linux:
osName: 'Linux'
2020-01-24 22:13:10 +00:00
imageName: 'ubuntu-18.04'
enableAnalysis: 'true'
Mac:
osName: 'Mac'
2020-01-24 22:13:10 +00:00
imageName: 'macos-10.14'
enableAnalysis: 'false'
Windows:
osName: 'Windows'
2019-10-14 20:21:00 +00:00
imageName: 'windows-2019'
enableAnalysis: 'false'
pool:
vmImage: $(imageName)
variables:
# Disable stylecop here - linting errors get caught by the analyze task
EnableAnalyzers: $(enableAnalysis)
steps:
- checkout: self
submodules: true
fetchDepth: 1
- task: UseDotNet@2
2019-12-05 21:41:55 +00:00
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
2021-02-09 21:09:13 +00:00
- bash: |
BUNDLEDVERSIONS=${AGENT_TOOLSDIRECTORY}/dotnet/sdk/${DOTNETVERSION}/Microsoft.NETCoreSdk.BundledVersions.props
echo $BUNDLEDVERSIONS
grep osx-x64 $BUNDLEDVERSIONS
if grep -q freebsd-x64 $BUNDLEDVERSIONS; then
echo "BSD already enabled"
else
echo "Enabling BSD support"
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64/' $BUNDLEDVERSIONS
fi
displayName: Enable FreeBSD Support
- bash: ./build.sh --backend --enable-bsd
displayName: Build Radarr Backend
- bash: |
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
find ${OUTPUTFOLDER} -depth -empty -type d -exec rm -r "{}" \;
find ${TESTSFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
find ${TESTSFOLDER} -depth -empty -type d -exec rm -r "{}" \;
displayName: Clean up intermediate output
2020-01-19 19:28:04 +00:00
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
- publish: $(outputFolder)
artifact: '$(osName)Backend'
displayName: Publish Backend
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2020-08-25 20:26:45 +00:00
- publish: '$(testsFolder)/net5.0/win-x64/publish'
artifact: WindowsCoreTests
displayName: Publish Windows Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2021-01-11 01:54:54 +00:00
- publish: '$(testsFolder)/net472/linux-x64/publish'
artifact: LinuxTests
displayName: Publish Linux Mono Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2020-08-25 20:26:45 +00:00
- publish: '$(testsFolder)/net5.0/linux-x64/publish'
artifact: LinuxCoreTests
displayName: Publish Linux Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2020-08-25 20:26:45 +00:00
- publish: '$(testsFolder)/net5.0/linux-musl-x64/publish'
2020-07-26 20:52:27 +00:00
artifact: LinuxMuslCoreTests
displayName: Publish Linux Musl Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2021-02-09 21:09:13 +00:00
- publish: '$(testsFolder)/net5.0/freebsd-x64/publish'
artifact: FreebsdCoreTests
displayName: Publish FreeBSD Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2020-08-25 20:26:45 +00:00
- publish: '$(testsFolder)/net5.0/osx-x64/publish'
artifact: MacCoreTests
displayName: Publish MacOS Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- stage: Build_Frontend
2019-10-14 20:21:00 +00:00
displayName: Frontend
dependsOn: Setup
jobs:
2019-10-14 20:21:00 +00:00
- job: Build
strategy:
matrix:
Linux:
osName: 'Linux'
2020-01-24 22:13:10 +00:00
imageName: 'ubuntu-18.04'
Mac:
osName: 'Mac'
2020-01-24 22:13:10 +00:00
imageName: 'macos-10.14'
Windows:
osName: 'Windows'
2019-10-14 20:21:00 +00:00
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
2020-08-25 20:26:45 +00:00
versionSpec: '12.x'
- checkout: self
submodules: true
fetchDepth: 1
2020-08-21 02:25:50 +00:00
- task: Cache@2
inputs:
key: 'yarn | "$(osName)" | yarn.lock'
restoreKeys: |
yarn | "$(osName)"
yarn
path: $(yarnCacheFolder)
displayName: Cache Yarn packages
2019-10-14 20:21:00 +00:00
- bash: ./build.sh --frontend
displayName: Build Radarr Frontend
env:
FORCE_COLOR: 0
2020-08-21 02:25:50 +00:00
YARN_CACHE_FOLDER: $(yarnCacheFolder)
- publish: $(outputFolder)
artifact: '$(osName)Frontend'
displayName: Publish Frontend
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2019-10-14 20:21:00 +00:00
- stage: Installer
dependsOn:
- Build_Backend
- Build_Frontend
jobs:
- job: Windows_Installer
displayName: Create Installer
pool:
2019-10-14 20:21:00 +00:00
vmImage: 'windows-2019'
steps:
- checkout: self
fetchDepth: 1
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsBackend
targetPath: _output
displayName: Fetch Backend
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsFrontend
targetPath: _output
displayName: Fetch Frontend
2019-10-14 20:21:00 +00:00
- bash: ./build.sh --packages
displayName: Create Packages
- bash: |
2020-08-25 20:26:45 +00:00
setup/inno/ISCC.exe setup/radarr.iss //DFramework=net5.0 //DRuntime=win-x86
cp setup/output/Radarr.*windows.net5.0.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x86-installer.exe
2020-11-11 03:56:47 +00:00
displayName: Create .NET Core Windows installer
- bash: |
2020-08-25 20:26:45 +00:00
setup/inno/ISCC.exe setup/radarr.iss //DFramework=net5.0 //DRuntime=win-x64
cp setup/output/Radarr.*windows.net5.0.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x64-installer.exe
displayName: Create .NET Core Windows installer
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'WindowsInstaller'
displayName: Publish Installer
2019-10-14 20:21:00 +00:00
- stage: Packages
dependsOn:
- Build_Backend
- Build_Frontend
jobs:
- job: Other_Packages
displayName: Create Standard Packages
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
fetchDepth: 1
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsBackend
targetPath: _output
displayName: Fetch Backend
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsFrontend
targetPath: _output
displayName: Fetch Frontend
2021-02-09 21:09:13 +00:00
- bash: ./build.sh --packages --enable-bsd
displayName: Create Packages
- bash: |
2019-10-14 20:21:00 +00:00
find . -name "Radarr" -exec chmod a+x {} \;
find . -name "Radarr.Update" -exec chmod a+x {} \;
displayName: Set executable bits
- task: ArchiveFiles@2
displayName: Create Windows Core zip
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x64.zip'
archiveType: 'zip'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/win-x64/net5.0
2020-11-11 03:56:47 +00:00
- task: ArchiveFiles@2
displayName: Create Windows x86 Core zip
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x86.zip'
archiveType: 'zip'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/win-x86/net5.0
- task: ArchiveFiles@2
displayName: Create MacOS Core app
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-x64.zip'
archiveType: 'zip'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/macos-app/net5.0
- task: ArchiveFiles@2
displayName: Create MacOS Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-x64.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/macos/net5.0
- task: ArchiveFiles@2
displayName: Create Linux Mono tar
inputs:
2019-10-14 20:21:00 +00:00
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2021-01-11 01:54:54 +00:00
rootFolderOrFile: $(artifactsFolder)/linux-x64/net472
- task: ArchiveFiles@2
displayName: Create Linux Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-x64.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/linux-x64/net5.0
2020-07-26 20:52:27 +00:00
- task: ArchiveFiles@2
displayName: Create Linux Musl Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-x64.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/linux-musl-x64/net5.0
- task: ArchiveFiles@2
displayName: Create ARM32 Linux Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/linux-arm/net5.0
- task: ArchiveFiles@2
displayName: Create ARM64 Linux Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm64.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/linux-arm64/net5.0
2020-07-26 20:52:27 +00:00
- task: ArchiveFiles@2
displayName: Create ARM64 Linux Musl Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm64.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
2020-08-25 20:26:45 +00:00
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm64/net5.0
2021-02-09 21:09:13 +00:00
- task: ArchiveFiles@2
displayName: Create FreeBSD Core Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).freebsd-core-x64.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/freebsd-x64/net5.0
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'Packages'
displayName: Publish Packages
- bash: |
echo "Uploading source maps to sentry"
curl -sL https://sentry.io/get-cli/ | bash
RELEASENAME="${RADARRVERSION}-${BUILD_SOURCEBRANCHNAME}"
2020-04-28 06:13:49 +00:00
sentry-cli releases new --finalize -p radarr -p radarr-ui -p radarr-update "${RELEASENAME}"
sentry-cli releases -p radarr-ui files "${RELEASENAME}" upload-sourcemaps _output/UI/ --rewrite
sentry-cli releases set-commits --auto "${RELEASENAME}"
2020-09-27 02:03:14 +00:00
if [[ ${BUILD_SOURCEBRANCH} == "refs/heads/develop" ]]; then
sentry-cli releases deploys "${RELEASENAME}" new -e nightly
else
sentry-cli releases deploys "${RELEASENAME}" new -e production
fi
2020-04-22 18:18:38 +00:00
if [ $? -gt 0 ]; then
echo "##vso[task.logissue type=warning]Error uploading source maps."
fi
exit 0
displayName: Publish Sentry Source Maps
2020-09-27 02:03:14 +00:00
condition: |
or
(
and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')),
and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
)
env:
2020-04-28 05:26:05 +00:00
SENTRY_AUTH_TOKEN: $(sentryAuthTokenServarr)
SENTRY_ORG: $(sentryOrg)
2020-04-28 05:26:05 +00:00
SENTRY_URL: $(sentryUrl)
- stage: Unit_Test
displayName: Unit Tests
dependsOn: Build_Backend
jobs:
- job: Prepare
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'not_backend_update'
targetPath: '.'
- bash: echo "##vso[task.setvariable variable=backendNotUpdated;isOutput=true]$(cat not_backend_update)"
name: setVar
- job: Unit
2019-10-14 20:21:00 +00:00
displayName: Unit Native
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
2021-02-09 21:09:13 +00:00
workspace:
clean: all
strategy:
matrix:
MacCore:
osName: 'Mac'
testName: 'MacCore'
2021-02-09 21:09:13 +00:00
poolName: 'Azure Pipelines'
2020-01-24 22:13:10 +00:00
imageName: 'macos-10.14'
WindowsCore:
osName: 'Windows'
testName: 'WindowsCore'
2021-02-09 21:09:13 +00:00
poolName: 'Azure Pipelines'
2019-10-14 20:21:00 +00:00
imageName: 'windows-2019'
LinuxCore:
osName: 'Linux'
testName: 'LinuxCore'
2021-02-09 21:09:13 +00:00
poolName: 'Azure Pipelines'
2020-01-24 22:13:10 +00:00
imageName: 'ubuntu-18.04'
2021-02-09 21:09:13 +00:00
FreebsdCore:
osName: 'Linux'
testName: 'FreebsdCore'
poolName: 'FreeBSD'
imageName:
pool:
2021-02-09 21:09:13 +00:00
name: $(poolName)
vmImage: $(imageName)
steps:
- checkout: none
- task: UseDotNet@2
2019-12-05 21:41:55 +00:00
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
2021-02-09 21:09:13 +00:00
condition: ne(variables['poolName'], 'FreeBSD')
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: '$(testName)Tests'
targetPath: $(testsFolder)
- bash: |
wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-11_all.deb
sudo dpkg -i repo-mediaarea_1.0-11_all.deb
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated libmediainfo-dev libmediainfo0v5 mediainfo
2019-10-14 20:21:00 +00:00
displayName: Install mediainfo
2021-02-09 21:09:13 +00:00
condition: and(succeeded(), eq(variables['testName'], 'LinuxCore'))
- powershell: Set-Service SCardSvr -StartupType Manual
displayName: Enable Windows Test Service
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
2019-10-14 20:21:00 +00:00
- bash: |
2020-01-24 22:13:10 +00:00
SYMLINK=6_6_0
2019-10-14 20:21:00 +00:00
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
echo "##vso[task.setvariable variable=MONOPREFIX;]$MONOPREFIX"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
displayName: Set Mono Version
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
- bash: find ${TESTSFOLDER} -name "Radarr.Test.Dummy" -exec chmod a+x {} \;
displayName: Make Test Dummy Executable
2020-01-19 19:28:04 +00:00
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
2020-02-25 22:17:55 +00:00
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh ${OSNAME} Unit Test
displayName: Run Tests
env:
TEST_DIR: $(Build.SourcesDirectory)/_tests
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(testName) Unit Tests'
2019-10-14 20:21:00 +00:00
failTaskOnFailedTests: true
- job: Unit_Docker
displayName: Unit Docker
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
2019-10-14 20:21:00 +00:00
strategy:
matrix:
mono520:
testName: 'Mono 5.20'
2020-07-26 20:52:27 +00:00
artifactName: LinuxTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:mono-5.20
2020-01-20 22:00:25 +00:00
mono610:
testName: 'Mono 6.10'
2020-07-26 20:52:27 +00:00
artifactName: LinuxTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:mono-6.10
2020-07-21 20:00:30 +00:00
mono612:
testName: 'Mono 6.12'
2020-07-26 20:52:27 +00:00
artifactName: LinuxTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:mono-6.12
2020-07-26 20:52:27 +00:00
alpine:
testName: 'Musl Net Core'
artifactName: LinuxMuslCoreTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:alpine
2019-10-14 20:21:00 +00:00
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
2019-10-14 20:21:00 +00:00
container: $[ variables['containerImage'] ]
2019-10-14 20:21:00 +00:00
timeoutInMinutes: 10
steps:
- task: UseDotNet@2
2019-12-05 21:41:55 +00:00
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
2019-10-14 20:21:00 +00:00
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
2020-07-26 20:52:27 +00:00
artifactName: $(artifactName)
2019-10-14 20:21:00 +00:00
targetPath: $(testsFolder)
2020-07-26 20:52:27 +00:00
- bash: find ${TESTSFOLDER} -name "Radarr.Test.Dummy" -exec chmod a+x {} \;
displayName: Make Test Dummy Executable
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
2020-02-25 22:17:55 +00:00
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
2020-07-26 20:52:27 +00:00
ls -lR ${TESTSFOLDER}
2020-02-25 22:17:55 +00:00
${TESTSFOLDER}/test.sh Linux Unit Test
2019-10-14 20:21:00 +00:00
displayName: Run Tests
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(testName) Unit Tests'
failTaskOnFailedTests: true
- stage: Integration
displayName: Integration
dependsOn: Packages
jobs:
- job: Prepare
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'not_backend_update'
targetPath: '.'
- bash: echo "##vso[task.setvariable variable=backendNotUpdated;isOutput=true]$(cat not_backend_update)"
name: setVar
- job: Integration_Native
displayName: Integration Native
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
strategy:
matrix:
MacCore:
osName: 'Mac'
testName: 'MacCore'
2020-01-24 22:13:10 +00:00
imageName: 'macos-10.14'
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.osx-core-x64.tar.gz'
WindowsCore:
osName: 'Windows'
testName: 'WindowsCore'
2019-10-14 20:21:00 +00:00
imageName: 'windows-2019'
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.windows-core-x64.zip'
LinuxCore:
osName: 'Linux'
testName: 'LinuxCore'
2020-01-24 22:13:10 +00:00
imageName: 'ubuntu-18.04'
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.linux-core-x64.tar.gz'
pool:
vmImage: $(imageName)
steps:
- bash: |
2020-01-24 22:13:10 +00:00
SYMLINK=6_6_0
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
2019-10-14 20:21:00 +00:00
echo "##vso[task.setvariable variable=MONOPREFIX;]$MONOPREFIX"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
displayName: Set Mono Version
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
- task: UseDotNet@2
2019-12-05 21:41:55 +00:00
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: '$(testName)Tests'
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
inputs:
buildType: 'current'
artifactName: Packages
itemPattern: '**/$(pattern)'
targetPath: $(Build.ArtifactStagingDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
displayName: Extract Package
- bash: |
mkdir -p ./bin/
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
displayName: Move Package Contents
2020-02-25 22:17:55 +00:00
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh ${OSNAME} Integration Test
displayName: Run Integration Tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(testName) Integration Tests'
failTaskOnFailedTests: true
displayName: Publish Test Results
2021-02-09 21:09:13 +00:00
- job: Integration_FreeBSD
displayName: Integration Native FreeBSD
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
workspace:
clean: all
variables:
pattern: 'Radarr.*.freebsd-core-x64.tar.gz'
pool:
name: 'FreeBSD'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: 'FreebsdCoreTests'
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
inputs:
buildType: 'current'
artifactName: Packages
itemPattern: '/$(pattern)'
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
mkdir -p ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin
tar xf ${BUILD_ARTIFACTSTAGINGDIRECTORY}/$(pattern) -C ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin
displayName: Extract Package
- bash: |
mkdir -p ./bin/
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
displayName: Move Package Contents
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh Linux Integration Test
displayName: Run Integration Tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: 'FreeBSD Integration Tests'
failTaskOnFailedTests: true
2021-02-09 21:09:13 +00:00
displayName: Publish Test Results
- job: Integration_Docker
displayName: Integration Docker
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
strategy:
matrix:
mono520:
testName: 'Mono 5.20'
2020-07-26 20:52:27 +00:00
artifactName: LinuxTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:mono-5.20
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.linux.tar.gz'
2020-01-20 22:00:25 +00:00
mono610:
testName: 'Mono 6.10'
2020-07-26 20:52:27 +00:00
artifactName: LinuxTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:mono-6.10
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.linux.tar.gz'
2020-07-21 20:00:30 +00:00
mono612:
testName: 'Mono 6.12'
2020-07-26 20:52:27 +00:00
artifactName: LinuxTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:mono-6.12
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.linux.tar.gz'
2020-07-26 20:52:27 +00:00
alpine:
testName: 'Musl Net Core'
2020-08-17 21:18:47 +00:00
artifactName: LinuxMuslCoreTests
2021-01-19 21:43:53 +00:00
containerImage: ghcr.io/servarr/testimages:alpine
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.linux-musl-core-x64.tar.gz'
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
container: $[ variables['containerImage'] ]
2019-10-14 20:21:00 +00:00
timeoutInMinutes: 15
steps:
- task: UseDotNet@2
2019-12-05 21:41:55 +00:00
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
2020-07-26 20:52:27 +00:00
artifactName: $(artifactName)
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
inputs:
buildType: 'current'
artifactName: Packages
itemPattern: '**/$(pattern)'
targetPath: $(Build.ArtifactStagingDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
displayName: Extract Package
- bash: |
mkdir -p ./bin/
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
displayName: Move Package Contents
2020-02-25 22:17:55 +00:00
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh Linux Integration Test
displayName: Run Integration Tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(testName) Integration Tests'
failTaskOnFailedTests: true
displayName: Publish Test Results
2019-10-14 20:21:00 +00:00
- stage: Automation
displayName: Automation
dependsOn: Packages
jobs:
- job: Automation
strategy:
matrix:
Linux:
osName: 'Linux'
2020-01-24 22:13:10 +00:00
imageName: 'ubuntu-18.04'
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.linux-core-x64.tar.gz'
failBuild: true
Mac:
osName: 'Mac'
2020-08-18 03:33:22 +00:00
imageName: 'macos-10.14'
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.osx-core-x64.tar.gz'
2020-08-18 03:33:22 +00:00
failBuild: true
Windows:
osName: 'Windows'
2019-10-14 20:21:00 +00:00
imageName: 'windows-2019'
2021-02-09 21:09:13 +00:00
pattern: 'Radarr.*.windows-core-x64.zip'
2020-08-18 03:33:22 +00:00
failBuild: true
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
2019-12-05 21:41:55 +00:00
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: '$(osName)CoreTests'
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
inputs:
buildType: 'current'
artifactName: Packages
itemPattern: '**/$(pattern)'
targetPath: $(Build.ArtifactStagingDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
displayName: Extract Package
- bash: |
mkdir -p ./bin/
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
displayName: Move Package Contents
2020-02-25 22:17:55 +00:00
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh ${OSNAME} Automation Test
displayName: Run Automation Tests
- task: CopyFiles@2
displayName: 'Copy Screenshot to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*_test_screenshot.png
TargetFolder: '$(Build.ArtifactStagingDirectory)/screenshots'
- publish: $(Build.ArtifactStagingDirectory)/screenshots
artifact: '$(osName)AutomationScreenshots'
displayName: Publish Screenshot Bundle
2020-10-16 01:14:27 +00:00
condition: and(succeeded(), eq(variables['System.JobAttempt'], '1'))
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(osName) Automation Tests'
failTaskOnFailedTests: $(failBuild)
displayName: Publish Test Results
2019-10-14 20:21:00 +00:00
- stage: Analyze
dependsOn:
- Setup
2019-10-14 20:21:00 +00:00
displayName: Analyze
jobs:
- job: Prepare
pool:
2020-01-24 22:13:10 +00:00
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'not_backend_update'
targetPath: '.'
- bash: echo "##vso[task.setvariable variable=backendNotUpdated;isOutput=true]$(cat not_backend_update)"
name: setVar
2019-10-14 20:21:00 +00:00
- job: Lint_Frontend
displayName: Lint Frontend
strategy:
matrix:
Linux:
osName: 'Linux'
2020-01-24 22:13:10 +00:00
imageName: 'ubuntu-18.04'
2019-10-14 20:21:00 +00:00
Windows:
osName: 'Windows'
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
2020-08-25 20:26:45 +00:00
versionSpec: '12.x'
2019-10-14 20:21:00 +00:00
- checkout: self
submodules: true
fetchDepth: 1
2020-08-21 02:25:50 +00:00
- task: Cache@2
inputs:
key: 'yarn | "$(osName)" | yarn.lock'
restoreKeys: |
yarn | "$(osName)"
yarn
path: $(yarnCacheFolder)
displayName: Cache Yarn packages
2019-10-14 20:21:00 +00:00
- bash: ./build.sh --lint
displayName: Lint Radarr Frontend
env:
FORCE_COLOR: 0
2020-08-21 02:25:50 +00:00
YARN_CACHE_FOLDER: $(yarnCacheFolder)
2019-10-14 20:21:00 +00:00
2019-12-07 07:37:11 +00:00
- job: Analyze_Frontend
displayName: Frontend
2019-12-10 02:48:14 +00:00
condition: eq(variables['System.PullRequest.IsFork'], 'False')
2019-12-07 07:37:11 +00:00
pool:
vmImage: windows-2019
steps:
- checkout: self # Need history for Sonar analysis
- task: SonarCloudPrepare@1
env:
SONAR_SCANNER_OPTS: ''
inputs:
SonarCloud: 'SonarCloud'
organization: 'radarr'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'Radarr_Radarr.UI'
2019-12-10 02:48:14 +00:00
cliProjectName: 'RadarrUI'
2019-12-07 07:37:11 +00:00
cliProjectVersion: '$(radarrVersion)'
cliSources: './frontend'
- task: SonarCloudAnalyze@1
2019-12-07 07:37:11 +00:00
- job: Analyze_Backend
displayName: Backend
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
2019-12-07 07:37:11 +00:00
variables:
disable.coverage.autogenerate: 'true'
EnableAnalyzers: 'false'
pool:
vmImage: windows-2019
2019-12-07 07:37:11 +00:00
steps:
- task: UseDotNet@2
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
- checkout: self # Need history for Sonar analysis
submodules: true
- powershell: Set-Service SCardSvr -StartupType Manual
displayName: Enable Windows Test Service
- task: SonarCloudPrepare@1
2019-12-10 02:48:14 +00:00
condition: eq(variables['System.PullRequest.IsFork'], 'False')
2019-12-07 07:37:11 +00:00
inputs:
SonarCloud: 'SonarCloud'
organization: 'radarr'
scannerMode: 'MSBuild'
projectKey: 'Radarr_Radarr'
projectName: 'Radarr'
projectVersion: '$(radarrVersion)'
extraProperties: |
sonar.exclusions=**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**
2021-05-23 16:44:19 +00:00
sonar.coverage.exclusions=**/Radarr.Api.V3/**/*
2019-12-07 07:37:11 +00:00
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/CoverageResults/**/coverage.opencover.xml
sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
- bash: |
2020-08-25 20:26:45 +00:00
./build.sh --backend -f net5.0 -r win-x64
TEST_DIR=_tests/net5.0/win-x64/publish/ ./test.sh Windows Unit Coverage
2019-12-07 07:37:11 +00:00
displayName: Coverage Unit Tests
- task: SonarCloudAnalyze@1
2019-12-10 02:48:14 +00:00
condition: eq(variables['System.PullRequest.IsFork'], 'False')
2019-12-07 07:37:11 +00:00
displayName: Publish SonarCloud Results
- task: reportgenerator@4
displayName: Generate Coverage Report
inputs:
reports: '$(Build.SourcesDirectory)/CoverageResults/**/coverage.opencover.xml'
targetdir: '$(Build.SourcesDirectory)/CoverageResults/combined'
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
- task: PublishCodeCoverageResults@1
displayName: Publish Coverage Report
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: './CoverageResults/combined/Cobertura.xml'
reportDirectory: './CoverageResults/combined/'
2020-04-22 21:04:43 +00:00
- stage: Report_Out
dependsOn:
- Analyze
- Unit_Test
- Integration
- Automation
condition: eq(variables['system.pullrequest.isfork'], false)
2020-04-22 21:04:43 +00:00
displayName: Build Status Report
jobs:
- job:
displayName: Discord Notification
pool:
vmImage: 'windows-2019'
2020-04-22 21:04:43 +00:00
steps:
- task: DownloadPipelineArtifact@2
continueOnError: true
displayName: Download Screenshot Artifact
inputs:
buildType: 'current'
artifactName: 'WindowsAutomationScreenshots'
targetPath: $(Build.SourcesDirectory)
2020-04-22 21:04:43 +00:00
- checkout: none
- powershell: |
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Servarr/AzureDiscordNotify/master/DiscordNotify.ps1'))
2020-04-22 21:04:43 +00:00
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
DISCORDCHANNELID: $(discordChannelId)
DISCORDWEBHOOKKEY: $(discordWebhookKey)