mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-03 05:25:10 +00:00
New: Run linting in parallel
This commit is contained in:
parent
4a2276225c
commit
a75754a8ee
2 changed files with 84 additions and 25 deletions
|
@ -54,7 +54,7 @@ stages:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
submodules: true
|
submodules: true
|
||||||
fetchDepth: 1
|
fetchDepth: 1
|
||||||
- bash: ./build.sh --only-backend
|
- bash: ./build.sh --backend
|
||||||
displayName: Build Lidarr Backend
|
displayName: Build Lidarr Backend
|
||||||
- publish: $(outputFolder)
|
- publish: $(outputFolder)
|
||||||
artifact: '$(osName)Backend'
|
artifact: '$(osName)Backend'
|
||||||
|
@ -66,11 +66,11 @@ stages:
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
|
|
||||||
- stage: Build_Frontend
|
- stage: Build_Frontend
|
||||||
displayName: Build Frontend
|
displayName: Frontend
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Frontend
|
- job: Build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
Linux:
|
Linux:
|
||||||
|
@ -92,7 +92,7 @@ stages:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
submodules: true
|
submodules: true
|
||||||
fetchDepth: 1
|
fetchDepth: 1
|
||||||
- bash: ./build.sh --only-frontend
|
- bash: ./build.sh --frontend
|
||||||
displayName: Build Lidarr Frontend
|
displayName: Build Lidarr Frontend
|
||||||
env:
|
env:
|
||||||
FORCE_COLOR: 0
|
FORCE_COLOR: 0
|
||||||
|
@ -101,7 +101,7 @@ stages:
|
||||||
displayName: Publish Frontend
|
displayName: Publish Frontend
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
|
|
||||||
- stage: Package
|
- stage: Installer
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Build_Backend
|
- Build_Backend
|
||||||
- Build_Frontend
|
- Build_Frontend
|
||||||
|
@ -125,7 +125,7 @@ stages:
|
||||||
artifactName: WindowsFrontend
|
artifactName: WindowsFrontend
|
||||||
targetPath: _output
|
targetPath: _output
|
||||||
displayName: Fetch Frontend
|
displayName: Fetch Frontend
|
||||||
- bash: ./build.sh --only-packages
|
- bash: ./build.sh --packages
|
||||||
displayName: Create Packages
|
displayName: Create Packages
|
||||||
- bash: |
|
- bash: |
|
||||||
./setup/inno/ISCC.exe "./setup/lidarr.iss"
|
./setup/inno/ISCC.exe "./setup/lidarr.iss"
|
||||||
|
@ -134,7 +134,12 @@ stages:
|
||||||
- publish: $(Build.ArtifactStagingDirectory)
|
- publish: $(Build.ArtifactStagingDirectory)
|
||||||
artifact: 'WindowsInstaller'
|
artifact: 'WindowsInstaller'
|
||||||
displayName: Publish Installer
|
displayName: Publish Installer
|
||||||
|
|
||||||
|
- stage: Packages
|
||||||
|
dependsOn:
|
||||||
|
- Build_Backend
|
||||||
|
- Build_Frontend
|
||||||
|
jobs:
|
||||||
- job: Other_Packages
|
- job: Other_Packages
|
||||||
displayName: Create Standard Packages
|
displayName: Create Standard Packages
|
||||||
pool:
|
pool:
|
||||||
|
@ -154,7 +159,7 @@ stages:
|
||||||
artifactName: WindowsFrontend
|
artifactName: WindowsFrontend
|
||||||
targetPath: _output
|
targetPath: _output
|
||||||
displayName: Fetch Frontend
|
displayName: Fetch Frontend
|
||||||
- bash: ./build.sh --only-packages
|
- bash: ./build.sh --packages
|
||||||
displayName: Create Packages
|
displayName: Create Packages
|
||||||
- bash: |
|
- bash: |
|
||||||
chmod a+x $(artifactsFolder)/macos/Lidarr/fpcalc
|
chmod a+x $(artifactsFolder)/macos/Lidarr/fpcalc
|
||||||
|
@ -514,6 +519,31 @@ stages:
|
||||||
condition: eq(variables['system.pullrequest.isfork'], false)
|
condition: eq(variables['system.pullrequest.isfork'], false)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
- job: Lint_Frontend
|
||||||
|
displayName: Lint Frontend
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
Linux:
|
||||||
|
osName: 'Linux'
|
||||||
|
imageName: 'ubuntu-16.04'
|
||||||
|
Windows:
|
||||||
|
osName: 'Windows'
|
||||||
|
imageName: 'vs2017-win2016'
|
||||||
|
pool:
|
||||||
|
vmImage: $(imageName)
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
displayName: Set Node.js version
|
||||||
|
inputs:
|
||||||
|
versionSpec: '10.x'
|
||||||
|
- checkout: self
|
||||||
|
submodules: true
|
||||||
|
fetchDepth: 1
|
||||||
|
- bash: ./build.sh --lint
|
||||||
|
displayName: Lint Lidarr Frontend
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 0
|
||||||
|
|
||||||
- job: Analyze_Frontend
|
- job: Analyze_Frontend
|
||||||
displayName: Frontend
|
displayName: Frontend
|
||||||
pool:
|
pool:
|
||||||
|
@ -554,7 +584,7 @@ stages:
|
||||||
sonar.coverage.exclusions=**/Lidarr.Api.V1/**/*,**/MonoTorrent/**/*,**/Marr.Data/**/*
|
sonar.coverage.exclusions=**/Lidarr.Api.V1/**/*,**/MonoTorrent/**/*,**/Marr.Data/**/*
|
||||||
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/_tests/CoverageResults/coverage.opencover.xml
|
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/_tests/CoverageResults/coverage.opencover.xml
|
||||||
sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
|
sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
|
||||||
- bash: ./build.sh --only-backend
|
- bash: ./build.sh --backend
|
||||||
displayName: Build Lidarr Backend
|
displayName: Build Lidarr Backend
|
||||||
- task: Bash@3
|
- task: Bash@3
|
||||||
displayName: Coverage Unit Tests
|
displayName: Coverage Unit Tests
|
||||||
|
|
61
build.sh
61
build.sh
|
@ -141,15 +141,16 @@ Build()
|
||||||
ProgressEnd 'Build'
|
ProgressEnd 'Build'
|
||||||
}
|
}
|
||||||
|
|
||||||
RunGulp()
|
YarnInstall()
|
||||||
{
|
{
|
||||||
ProgressStart 'yarn install'
|
ProgressStart 'yarn install'
|
||||||
yarn install
|
yarn install
|
||||||
#npm-cache install npm || CheckExitCode npm install --no-optional --no-bin-links
|
#npm-cache install npm || CheckExitCode npm install --no-optional --no-bin-links
|
||||||
ProgressEnd 'yarn install'
|
ProgressEnd 'yarn install'
|
||||||
|
}
|
||||||
|
|
||||||
LintUI
|
RunGulp()
|
||||||
|
{
|
||||||
ProgressStart 'Running gulp'
|
ProgressStart 'Running gulp'
|
||||||
CheckExitCode yarn run build --production
|
CheckExitCode yarn run build --production
|
||||||
ProgressEnd 'Running gulp'
|
ProgressEnd 'Running gulp'
|
||||||
|
@ -305,21 +306,41 @@ case "$(uname -s)" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
POSITIONAL=()
|
POSITIONAL=()
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo "No arguments provided, building everything"
|
||||||
|
BACKEND=YES
|
||||||
|
FRONTEND=YES
|
||||||
|
PACKAGES=YES
|
||||||
|
LINT=YES
|
||||||
|
fi
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
case $key in
|
case $key in
|
||||||
--only-backend)
|
--backend)
|
||||||
ONLY_BACKEND=YES
|
BACKEND=YES
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--only-frontend)
|
--frontend)
|
||||||
ONLY_FRONTEND=YES
|
FRONTEND=YES
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--only-packages)
|
--packages)
|
||||||
ONLY_PACKAGES=YES
|
PACKAGES=YES
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
--lint)
|
||||||
|
LINT=YES
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
--all)
|
||||||
|
BACKEND=YES
|
||||||
|
FRONTEND=YES
|
||||||
|
PACKAGES=YES
|
||||||
|
LINT=YES
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
*) # unknown option
|
*) # unknown option
|
||||||
|
@ -330,22 +351,30 @@ esac
|
||||||
done
|
done
|
||||||
set -- "${POSITIONAL[@]}" # restore positional parameters
|
set -- "${POSITIONAL[@]}" # restore positional parameters
|
||||||
|
|
||||||
# Only build backend if we haven't set only-frontend or only-packages
|
if [ "$BACKEND" == "YES" ];
|
||||||
if [ -z "$ONLY_FRONTEND" ] && [ -z "$ONLY_PACKAGES" ];
|
|
||||||
then
|
then
|
||||||
UpdateVersionNumber
|
UpdateVersionNumber
|
||||||
Build
|
Build
|
||||||
PackageTests
|
PackageTests
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only build frontend if we haven't set only-backend or only-packages
|
if [ "$FRONTEND" == "YES" ];
|
||||||
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_PACKAGES" ];
|
|
||||||
then
|
then
|
||||||
RunGulp
|
YarnInstall
|
||||||
|
RunGulp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only package if we haven't set only-backend or only-frontend
|
if [ "$LINT" == "YES" ];
|
||||||
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_FRONTEND" ];
|
then
|
||||||
|
if [ -z "$FRONTEND" ];
|
||||||
|
then
|
||||||
|
YarnInstall
|
||||||
|
fi
|
||||||
|
|
||||||
|
LintUI
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$PACKAGES" == "YES" ];
|
||||||
then
|
then
|
||||||
UpdateVersionNumber
|
UpdateVersionNumber
|
||||||
PackageMono
|
PackageMono
|
||||||
|
|
Loading…
Reference in a new issue