diff --git a/Directory.Build.props b/Directory.Build.props index 45d05760c..80a70e73b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,6 +2,8 @@ true $(MSBuildThisFileDirectory)style.ruleset + true + QUT Ecoacoustics Research Group diff --git a/README.md b/README.md index a2aaec0aa..ca532d522 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ citations will printed in the console and in the log file. ## Build status -[![Build status](https://ci.appveyor.com/api/projects/status/ntf6vtuy5wnlww37/branch/master?svg=true)](https://ci.appveyor.com/project/QUTEcoacousticsResearchGroup/audio-analysis/branch/master) +[![Build Status](https://dev.azure.com/QutEcoacoustics/audio-analysis/_apis/build/status/QutEcoacoustics.audio-analysis?branchName=master)](https://dev.azure.com/QutEcoacoustics/audio-analysis/_build/latest?definitionId=3&branchName=master) Weekly versions of AnalysisPrograms.exe are now built automatically at midnight Monday night. You can get copies from the [Releases](https://github.com/QutBioacoustics/audio-analysis/releases) page. diff --git a/appveyor.yml b/appveyor.yml index 59e54f486..4aece6760 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,16 +1,16 @@ -# overwrite the default version scheme - we have our own set in MsBuild -version: '{build}' +# # overwrite the default version scheme - we have our own set in MsBuild +# version: '{build}' -image: Visual Studio 2017 +# image: Visual Studio 2017 -skip_commits: - # allow us to manually skip a build - message: '/\[chore\]|\[no_ci\]|\[ci_skip\]|\[skip_ci\]/' - # Do not trigger a build for anything not .NET - files: - - '**/*.md' - - 'docs/**/*' - - 'scripts/**/*' +# skip_commits: +# # allow us to manually skip a build +# message: '/\[chore\]|\[no_ci\]|\[ci_skip\]|\[skip_ci\]/' +# # Do not trigger a build for anything not .NET +# files: +# - '**/*.md' +# - 'docs/**/*' +# - 'scripts/**/*' # Do not run a build on new tags - we use tags to create releases, which can # only occur after successful build on another branch @@ -24,7 +24,7 @@ cache: matrix: fast_finish: true - + platform: - Any CPU @@ -50,8 +50,8 @@ init: - echo Starting Build before_build: - # Download fresh lfs assets - - git lfs pull + # # Download fresh lfs assets + # - git lfs pull # Determine whether or not we should tag and release # if the last tag hash matches the current build hash then we should not duplicate a release - ps: | @@ -61,7 +61,7 @@ before_build: $env:RELEASE_COMMIT = $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -ilike "*``[release``]*" $env:SHOULD_RELEASE = ($env:RELEASE_COMMIT -ieq "true") -or ($env:APPVEYOR_SCHEDULED_BUILD -and ($env:TAG_NOT_PREVIOUSLY_RELEASED -ieq "true")) ls env:* -Include SHOULD*,APPVEYOR_SCHEDULED_BUILD*,APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED*,RELEASE_COMMIT,TAG_NOT_PREVIOUSLY_RELEASED - # Restore packages + # Restore packages - nuget restore # Debugging a dirty flag in build version - git status @@ -70,16 +70,16 @@ before_build: build_script: - echo "Building Debug" - ps: > - msbuild - "C:\projects\audio-analysis\AudioAnalysis.sln" /m /verbosity:minimal + msbuild + "C:\projects\audio-analysis\AudioAnalysis.sln" /m /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:WarningLevel=0 /p:RunCodeAnalysis=false /p:Configuration=Debug /property:Platform=$env:platform - echo "Building Release" - ps: > - msbuild - "C:\projects\audio-analysis\AudioAnalysis.sln" /m /verbosity:minimal + msbuild + "C:\projects\audio-analysis\AudioAnalysis.sln" /m /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:WarningLevel=0 /p:RunCodeAnalysis=false /p:Configuration=Release /property:Platform=$env:platform @@ -97,7 +97,7 @@ test: only: - 'tests\Acoustics.Test\bin\Debug\Acoustics.Test.dll' - 'tests\AED.Test\bin\Debug\AED.Test.dll' - + # Upload previously generated artifacts artifacts: - path: '$(ApPackageDebug)' @@ -112,7 +112,7 @@ before_deploy: - ps: git config --global user.name "$($env:APPVEYOR_REPO_COMMIT_AUTHOR)" # add our auth token to the cred store - ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GH_CREATE_RELEASES_TOKEN):x-oauth-basic@github.com`n" - # tag if needed, and output $env:ApTagName + # tag if needed, and output $env:ApTagName - cd %APPVEYOR_BUILD_FOLDER% # Buggy authentication with git-lfs - git config lfs.https://github.com/QutBioacoustics/audio-analysis.git/info/lfs.locksverify false @@ -120,7 +120,7 @@ before_deploy: # prepare release strings: $env:ApReleaseMessage, $env:ApReleaseTitle - ps: . .\build\release.ps1 $env:ApTagName $true #- ps: 'ls env:' - + deploy: - provider: GitHub tag: $(ApTagName) @@ -134,7 +134,7 @@ deploy: branch: master # Do not create a new release unless this was a scheduled build or a forced build SHOULD_RELEASE: True - + # scripts to run after deployment #after_deploy: # # build and push our docker image @@ -149,6 +149,6 @@ notifications: on_build_status_changed: true on_build_failure: true on_build_success: true - + #on_finish: # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 671f8098d..7dbc3f7bc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,23 +1,47 @@ -# 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 +name: $(Date:yyyyMMdd)$(Rev:.r) -trigger: none +variables: + build: '$(Build.BuildID)' -jobs: -- job: Linux - pool: - vmImage: 'ubuntu-18.04' - steps: - - script: echo hello from Linux -- job: macOS - pool: - vmImage: 'macOS-10.14' - steps: - - script: echo hello from macOS -- job: Windows - pool: - vmImage: 'windows-2019' - steps: - - script: echo hello from Windows +# Run on all commits, except for some folders +trigger: + branches: + include: + - '*' + paths: + exclude: + - docs/* + - scripts/* + - '**/*.md' + +stages: + - stage: build + jobs: + - template: build/azure-pipelines-build.yml + # - stage: test + # jobs: + # - template: build/azure-pipelines-test.yml + # - stage: release + # jobs: + # - template: build/azure-pipelines-release.yml + +# jobs: +# - job: Linux +# pool: +# vmImage: 'ubuntu-latest' +# - job: macOS +# pool: +# vmImage: 'macOS-latest' +# - job: Windows +# pool: +# vmImage: 'windows-latest' + +# strategy: +# maxParallel: 2 +# matrix: +# AnyCPU-Debug: +# buildPlatform: 'Any CPU' +# buildConfiguration: 'Debug' +# AnyCPU-Release: +# buildPlatform: 'Any CPU' +# buildConfiguration: 'Release' \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index c07c0f1de..a6253a25e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -3,4 +3,7 @@ #Requires -Version 6 -Write-Output "Empty stub, do not use yet" \ No newline at end of file +Write-Output "Empty stub, do not use yet" + + +dotnet test --no-build --settings test/Acoustics.Test/.runsettings \ No newline at end of file diff --git a/build/azure-pipelines-build.yml b/build/azure-pipelines-build.yml new file mode 100644 index 000000000..abac48478 --- /dev/null +++ b/build/azure-pipelines-build.yml @@ -0,0 +1,82 @@ +parameters: + + buildPlatform: 'Any CPU' + configurations: [debug, release] + platforms: + - rid: win-x64 + pool: windows-latest + - rid: win-arm64 + pool: windows-latest + - rid: linux-x64 + pool: ubuntu-latest + - rid: linux-musl-x64 + pool: ubuntu-latest + - rid: linux-arm + pool: ubuntu-latest + - rid: osx-x64 + pool: macos-latest + + # cross-product not supported + # https://github.com/microsoft/azure-pipelines-yaml/issues/20 + job_matrix: + + linux_arm_debug: + pool: ubuntu-latest + + buildConfiguration: 'Debug' + rid: + + +jobs: + - job: + strategy: + matrix: + ${{ each platform in parameters.platforms }}: + ${{ each configuration in parameters.configurations }}: + ${{ format('{0}_{1}_{2}', platform.rid, platform.pool, configuration) }}: + rid: ${{ platform.rid }} + pool: ${{ platform.pool }} + configuration: ${{ configuration }} + pool: + vmImage: $(pool) + displayName: Build, test and package for + steps: + + - checkout: self + clean: false + fetchDepth: 100 + lfs: false + persistCredentials: true + displayName: "Shallow cloning repo" + + - task: Cache@2 + inputs: + key: "lfs_assets" + path: "$(Pipeline.Workspace)/.git/lfs/objects" + displayName: "Cache git LFS objects" + + - pwsh: git lfs pull + displayName: "Refresh LFS assets" + + - pwsh: | + $sdkVersion = (Get-Content "global.json" | ConvertFrom-Json).sdk.version + echo "##vso[task.setvariable variable=sdkVersion]$sdkVersion" + displayName: Get .NET SDK version from "global.json" + + - task: UseDotNet@2 + inputs: + packageType: sdk + version: $(sdkVersion) + displayName: Lock down .NET SDK version + + - task: DotNetCoreCLI@2 + inputs: + command: restore + displayName: Restore solution dependencies + + - pwsh: + - task: DotNetCoreCLI@2 + inputs: + command: build + arguments: '--configuration $(buildConfiguration)' + displayName: Build solution ($(buildConfiguration)) diff --git a/build/azure-pipelines-job-matrix.yml b/build/azure-pipelines-job-matrix.yml new file mode 100644 index 000000000..e69de29bb diff --git a/build/azure-pipelines-release.yml b/build/azure-pipelines-release.yml new file mode 100644 index 000000000..421d91cb3 --- /dev/null +++ b/build/azure-pipelines-release.yml @@ -0,0 +1,17 @@ + + +jobs: + + - job: 'publish' + steps: + - task: DotNetCoreCLI@2 + inputs: + command: publish + projects: src/AnalysisPrograms/AnalysisPrograms.csproj + arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)' + modifyOutputPath: true + zipAfterPublish: true + - task: PublishBuildArtifacts@1 + inputs: + path: $(Build.ArtifactStagingDirectory) + artifact: drop \ No newline at end of file diff --git a/build/azure-pipelines-test.yml b/build/azure-pipelines-test.yml new file mode 100644 index 000000000..4c83edbee --- /dev/null +++ b/build/azure-pipelines-test.yml @@ -0,0 +1,16 @@ + + +jobs: + - job: 'test' + steps: + - task: DotNetCoreCLI@2 + inputs: + command: test + noBuild: true + publishTestResults: true + arguments: "--settings test/Acoustics.Test/.runsettings --configuration $(buildConfiguration) --logger trx" + - task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testRunner: VSTest + testResultsFiles: '**/*.trx' diff --git a/build/mono_install.sh b/build/mono_install.sh deleted file mode 100644 index e7be012fa..000000000 --- a/build/mono_install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# http://www.mono-project.com/download/#download-lin-debian -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -echo "deb http://download.mono-project.com/repo/debian stretch main" | sudo tee /etc/apt/sources.list.d/mono-official.list -sudo apt-get update -DEBIAN_FRONTEND=noninteractive sudo apt-get install -y mono-complete --allow-unauthenticated \ No newline at end of file diff --git a/src/AED/AED.fsproj b/src/AED/AED.fsproj index 7a358c758..92ea88bb0 100644 --- a/src/AED/AED.fsproj +++ b/src/AED/AED.fsproj @@ -1,14 +1,8 @@ - AED.New - true - netcoreapp3.1 - 4.4.1.0 - true - AED - 3 - bin\$(Configuration)\ - true + netcoreapp3.1 + AED + true portable diff --git a/src/Acoustics.Shared.FSharp/Acoustics.Shared.FSharp.fsproj b/src/Acoustics.Shared.FSharp/Acoustics.Shared.FSharp.fsproj index 34ec1f14a..ed17da2db 100644 --- a/src/Acoustics.Shared.FSharp/Acoustics.Shared.FSharp.fsproj +++ b/src/Acoustics.Shared.FSharp/Acoustics.Shared.FSharp.fsproj @@ -1,13 +1,10 @@ - + Acoustics.Shared.FSharp Acoustics.Shared.FSharp netcoreapp3.1 - 4.4.1.0 - true Acoustics.Shared.FSharp - 3 - bin\$(Configuration)\ + true portable diff --git a/tests/AED.Test/AED.Test.fsproj b/tests/AED.Test/AED.Test.fsproj index 47ec1753f..db665183b 100644 --- a/tests/AED.Test/AED.Test.fsproj +++ b/tests/AED.Test/AED.Test.fsproj @@ -2,16 +2,10 @@ true netcoreapp3.1 - 4.4.1.0 - true - AED.Test - bin\$(Configuration)\$(AssemblyName).XML - 3 - bin\$(Configuration)\ - false + AED.Test - full + portable false