diff --git a/FollowingFileStream.SourceBrowser/FollowingFileStream.SourceBrowser.csproj b/FollowingFileStream.SourceBrowser/FollowingFileStream.SourceBrowser.csproj new file mode 100644 index 0000000..f5b8f1d --- /dev/null +++ b/FollowingFileStream.SourceBrowser/FollowingFileStream.SourceBrowser.csproj @@ -0,0 +1,11 @@ + + + netstandard2.0 + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 4fd26b7..e1cf3f3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Any read operation will not report a zero result while the file is locked for wr It is usually compared to the "tail -f" approach. +[Source Browser](https://followingfilestream.azurewebsites.net/#FollowingFileStream/) [![Build Status](https://dev.azure.com/manandre/manandre/_apis/build/status/manandre.FollowingFileStream?branchName=master)](https://dev.azure.com/manandre/manandre/_build/latest?definitionId=1&branchName=master) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eab6a82..112f9ec 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,108 +6,144 @@ trigger: - master -strategy: - matrix: - linux: - imageName: 'ubuntu-latest' - mac: - imageName: 'macos-latest' - windows: - imageName: 'windows-latest' - -pool: - vmImage: $(imageName) - variables: buildConfiguration: 'Release' -steps: -- task: GitVersion@5 - inputs: - runtime: 'core' -- task: SonarCloudPrepare@1 - inputs: - SonarCloud: 'SonarCloud' - organization: 'manandre' - scannerMode: 'MSBuild' - projectKey: 'manandre_FollowingFileStream' - projectVersion: '$(Build.BuildId)' - extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverage/coverage.opencover.xml' - -- task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: 'restore' - projects: '**/*.csproj' - feedsToUse: 'select' - versioningScheme: byBuildNumber - -- task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: 'build' - projects: 'All.sln' # Mandatory for SonarQube !?! - arguments: '--configuration $(BuildConfiguration) /p:Version=$(GitVersion.NuGetVersion)' - versioningScheme: byBuildNumber - -- task: DotNetCoreCLI@2 - displayName: Test - inputs: - command: 'test' - projects: '**/*.Tests.csproj' - arguments: '--configuration $(buildConfiguration) --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=$(Build.SourcesDirectory)/coverage/' - publishTestResults: false - -- task: PublishTestResults@2 - displayName: Publish Test Results - condition: succeededOrFailed() - inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' - -- script: | - dotnet tool install dotnet-reportgenerator-globaltool --tool-path . - ./reportgenerator "-reports:$(Build.SourcesDirectory)/coverage/coverage.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart" - condition: eq( variables['Agent.OS'], 'Linux' ) - displayName: Run Reportgenerator on Linux - -- script: | - dotnet tool install dotnet-reportgenerator-globaltool --tool-path . - .\reportgenerator.exe "-reports:$(Build.SourcesDirectory)/coverage/coverage.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart" - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Run Reportgenerator on Windows - -- task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: $(Build.SourcesDirectory)/coverage/Cobertura/Cobertura.xml - -- task: SonarCloudAnalyze@1 - -- task: SonarCloudPublish@1 - inputs: - pollingTimeoutSec: '300' - -- task: DotNetCoreCLI@2 - displayName: Pack - inputs: - command: 'pack' - packagesToPack: '**/*.csproj' - nobuild: true - versioningScheme: 'byEnvVar' - versionEnvVar: 'GitVersion.NuGetVersion' - -- task: PublishSymbols@2 - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - inputs: - SearchPattern: | - **/bin/**/FollowingFileStream.pdb - **/bin/**/FollowingFileStream.dll - IndexSources: false - SymbolServerType: 'TeamServices' - -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' - publishLocation: 'Container' \ No newline at end of file +jobs: + - job: Build + strategy: + matrix: + linux: + imageName: 'ubuntu-latest' + mac: + imageName: 'macos-latest' + windows: + imageName: 'windows-latest' + + pool: + vmImage: $(imageName) + + steps: + - task: GitVersion@5 + inputs: + runtime: 'core' + - task: SonarCloudPrepare@1 + inputs: + SonarCloud: 'SonarCloud' + organization: 'manandre' + scannerMode: 'MSBuild' + projectKey: 'manandre_FollowingFileStream' + projectVersion: '$(Build.BuildId)' + extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverage/coverage.opencover.xml' + + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: 'restore' + projects: '**/*.csproj' + feedsToUse: 'select' + versioningScheme: byBuildNumber + + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + command: 'build' + projects: 'All.sln' # Mandatory for SonarQube !?! + arguments: '--configuration $(BuildConfiguration) /p:Version=$(GitVersion.NuGetVersion)' + versioningScheme: byBuildNumber + + - task: DotNetCoreCLI@2 + displayName: Test + inputs: + command: 'test' + projects: '**/*.Tests.csproj' + arguments: '--configuration $(buildConfiguration) --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=$(Build.SourcesDirectory)/coverage/' + publishTestResults: false + + - task: PublishTestResults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + inputs: + testRunner: VSTest + testResultsFiles: '**/*.trx' + + - script: | + dotnet tool install dotnet-reportgenerator-globaltool --tool-path . + ./reportgenerator "-reports:$(Build.SourcesDirectory)/coverage/coverage.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart" + condition: eq( variables['Agent.OS'], 'Linux' ) + displayName: Run Reportgenerator on Linux + + - script: | + dotnet tool install dotnet-reportgenerator-globaltool --tool-path . + .\reportgenerator.exe "-reports:$(Build.SourcesDirectory)/coverage/coverage.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart" + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + displayName: Run Reportgenerator on Windows + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: 'Cobertura' + summaryFileLocation: $(Build.SourcesDirectory)/coverage/Cobertura/Cobertura.xml + + - task: SonarCloudAnalyze@1 + + - task: SonarCloudPublish@1 + inputs: + pollingTimeoutSec: '300' + + - task: DotNetCoreCLI@2 + displayName: Pack + inputs: + command: 'pack' + packagesToPack: 'FollowingFileStream/*.csproj' + nobuild: true + versioningScheme: 'byEnvVar' + versionEnvVar: 'GitVersion.NuGetVersion' + + - task: PublishSymbols@2 + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + inputs: + SearchPattern: | + **/bin/**/FollowingFileStream.pdb + **/bin/**/FollowingFileStream.dll + IndexSources: false + SymbolServerType: 'TeamServices' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' + + - job: SourceBrowser + displayName: Source Browser generation + pool: + vmImage: 'windows-latest' + steps: + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: 'restore' + projects: '**/*.SourceBrowser.csproj' + feedsToUse: 'select' + + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + command: 'build' + projects: '**/*.SourceBrowser.csproj' + arguments: '--configuration $(BuildConfiguration)' + + - task: ArchiveFiles@2 + displayName: Zip source browser website + inputs: + rootFolderOrFile: '$(Build.SourcesDirectory)/FollowingFileStream.SourceBrowser/bin/Index' + includeRootFolder: false + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/sourcebrowser_website.zip' + replaceExistingArchive: true + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/sourcebrowser_website.zip' + ArtifactName: 'sourcebrowser_website' + publishLocation: 'Container'