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
|
||||
submodules: true
|
||||
fetchDepth: 1
|
||||
- bash: ./build.sh --only-backend
|
||||
- bash: ./build.sh --backend
|
||||
displayName: Build Lidarr Backend
|
||||
- publish: $(outputFolder)
|
||||
artifact: '$(osName)Backend'
|
||||
|
@ -66,11 +66,11 @@ stages:
|
|||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||
|
||||
- stage: Build_Frontend
|
||||
displayName: Build Frontend
|
||||
displayName: Frontend
|
||||
dependsOn: []
|
||||
|
||||
jobs:
|
||||
- job: Frontend
|
||||
- job: Build
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
|
@ -92,7 +92,7 @@ stages:
|
|||
- checkout: self
|
||||
submodules: true
|
||||
fetchDepth: 1
|
||||
- bash: ./build.sh --only-frontend
|
||||
- bash: ./build.sh --frontend
|
||||
displayName: Build Lidarr Frontend
|
||||
env:
|
||||
FORCE_COLOR: 0
|
||||
|
@ -101,7 +101,7 @@ stages:
|
|||
displayName: Publish Frontend
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||
|
||||
- stage: Package
|
||||
- stage: Installer
|
||||
dependsOn:
|
||||
- Build_Backend
|
||||
- Build_Frontend
|
||||
|
@ -125,7 +125,7 @@ stages:
|
|||
artifactName: WindowsFrontend
|
||||
targetPath: _output
|
||||
displayName: Fetch Frontend
|
||||
- bash: ./build.sh --only-packages
|
||||
- bash: ./build.sh --packages
|
||||
displayName: Create Packages
|
||||
- bash: |
|
||||
./setup/inno/ISCC.exe "./setup/lidarr.iss"
|
||||
|
@ -135,6 +135,11 @@ stages:
|
|||
artifact: 'WindowsInstaller'
|
||||
displayName: Publish Installer
|
||||
|
||||
- stage: Packages
|
||||
dependsOn:
|
||||
- Build_Backend
|
||||
- Build_Frontend
|
||||
jobs:
|
||||
- job: Other_Packages
|
||||
displayName: Create Standard Packages
|
||||
pool:
|
||||
|
@ -154,7 +159,7 @@ stages:
|
|||
artifactName: WindowsFrontend
|
||||
targetPath: _output
|
||||
displayName: Fetch Frontend
|
||||
- bash: ./build.sh --only-packages
|
||||
- bash: ./build.sh --packages
|
||||
displayName: Create Packages
|
||||
- bash: |
|
||||
chmod a+x $(artifactsFolder)/macos/Lidarr/fpcalc
|
||||
|
@ -514,6 +519,31 @@ stages:
|
|||
condition: eq(variables['system.pullrequest.isfork'], false)
|
||||
|
||||
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
|
||||
displayName: Frontend
|
||||
pool:
|
||||
|
@ -554,7 +584,7 @@ stages:
|
|||
sonar.coverage.exclusions=**/Lidarr.Api.V1/**/*,**/MonoTorrent/**/*,**/Marr.Data/**/*
|
||||
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/_tests/CoverageResults/coverage.opencover.xml
|
||||
sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
|
||||
- bash: ./build.sh --only-backend
|
||||
- bash: ./build.sh --backend
|
||||
displayName: Build Lidarr Backend
|
||||
- task: Bash@3
|
||||
displayName: Coverage Unit Tests
|
||||
|
|
59
build.sh
59
build.sh
|
@ -141,15 +141,16 @@ Build()
|
|||
ProgressEnd 'Build'
|
||||
}
|
||||
|
||||
RunGulp()
|
||||
YarnInstall()
|
||||
{
|
||||
ProgressStart 'yarn install'
|
||||
yarn install
|
||||
#npm-cache install npm || CheckExitCode npm install --no-optional --no-bin-links
|
||||
ProgressEnd 'yarn install'
|
||||
}
|
||||
|
||||
LintUI
|
||||
|
||||
RunGulp()
|
||||
{
|
||||
ProgressStart 'Running gulp'
|
||||
CheckExitCode yarn run build --production
|
||||
ProgressEnd 'Running gulp'
|
||||
|
@ -305,21 +306,41 @@ case "$(uname -s)" in
|
|||
esac
|
||||
|
||||
POSITIONAL=()
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "No arguments provided, building everything"
|
||||
BACKEND=YES
|
||||
FRONTEND=YES
|
||||
PACKAGES=YES
|
||||
LINT=YES
|
||||
fi
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
--only-backend)
|
||||
ONLY_BACKEND=YES
|
||||
--backend)
|
||||
BACKEND=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--only-frontend)
|
||||
ONLY_FRONTEND=YES
|
||||
--frontend)
|
||||
FRONTEND=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--only-packages)
|
||||
ONLY_PACKAGES=YES
|
||||
--packages)
|
||||
PACKAGES=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--lint)
|
||||
LINT=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--all)
|
||||
BACKEND=YES
|
||||
FRONTEND=YES
|
||||
PACKAGES=YES
|
||||
LINT=YES
|
||||
shift # past argument
|
||||
;;
|
||||
*) # unknown option
|
||||
|
@ -330,22 +351,30 @@ esac
|
|||
done
|
||||
set -- "${POSITIONAL[@]}" # restore positional parameters
|
||||
|
||||
# Only build backend if we haven't set only-frontend or only-packages
|
||||
if [ -z "$ONLY_FRONTEND" ] && [ -z "$ONLY_PACKAGES" ];
|
||||
if [ "$BACKEND" == "YES" ];
|
||||
then
|
||||
UpdateVersionNumber
|
||||
Build
|
||||
PackageTests
|
||||
fi
|
||||
|
||||
# Only build frontend if we haven't set only-backend or only-packages
|
||||
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_PACKAGES" ];
|
||||
if [ "$FRONTEND" == "YES" ];
|
||||
then
|
||||
YarnInstall
|
||||
RunGulp
|
||||
fi
|
||||
|
||||
# Only package if we haven't set only-backend or only-frontend
|
||||
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_FRONTEND" ];
|
||||
if [ "$LINT" == "YES" ];
|
||||
then
|
||||
if [ -z "$FRONTEND" ];
|
||||
then
|
||||
YarnInstall
|
||||
fi
|
||||
|
||||
LintUI
|
||||
fi
|
||||
|
||||
if [ "$PACKAGES" == "YES" ];
|
||||
then
|
||||
UpdateVersionNumber
|
||||
PackageMono
|
||||
|
|
Loading…
Reference in a new issue