Skip to content

Commit

Permalink
First (failing attempt) to make Azure Pipelines work
Browse files Browse the repository at this point in the history
This is a combination of 14 commits.

Update azure-pipelines.yml for Azure Pipelines

CI attempt

fix indentation

change variable expression syntax

attempt

attempt

fix displayName

Update title

try setting vmImage

try runtime expression

Fix cache, try again with displayname

lock down .net sdk, add nuget config to restore

fixed sdk version

Work done for #196
  • Loading branch information
atruskie committed Mar 6, 2020
1 parent a0cddca commit 5a32882
Show file tree
Hide file tree
Showing 13 changed files with 198 additions and 76 deletions.
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<Deterministic>true</Deterministic>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)style.ruleset</CodeAnalysisRuleSet>
<DisableAutoSetFscCompilerPath>true</DisableAutoSetFscCompilerPath>
<DotnetFscCompilerPath></DotnetFscCompilerPath>
</PropertyGroup>
<PropertyGroup Label="Common">
<Company>QUT Ecoacoustics Research Group</Company>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
48 changes: 24 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,7 +24,7 @@ cache:

matrix:
fast_finish: true

platform:
- Any CPU

Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)'
Expand All @@ -112,15 +112,15 @@ 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):[email protected]`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
- ps: . .\build\tag.ps1 $env:ApVersion
# prepare release strings: $env:ApReleaseMessage, $env:ApReleaseTitle
- ps: . .\build\release.ps1 $env:ApTagName $true
#- ps: 'ls env:'

deploy:
- provider: GitHub
tag: $(ApTagName)
Expand All @@ -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
Expand All @@ -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'))
66 changes: 45 additions & 21 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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'
5 changes: 4 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
#Requires -Version 6


Write-Output "Empty stub, do not use yet"
Write-Output "Empty stub, do not use yet"


dotnet test --no-build --settings test/Acoustics.Test/.runsettings
82 changes: 82 additions & 0 deletions build/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
@@ -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))
Empty file.
17 changes: 17 additions & 0 deletions build/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions build/azure-pipelines-test.yml
Original file line number Diff line number Diff line change
@@ -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'
7 changes: 0 additions & 7 deletions build/mono_install.sh

This file was deleted.

12 changes: 3 additions & 9 deletions src/AED/AED.fsproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>AED.New</RootNamespace>
<UseStandardResourceNames>true</UseStandardResourceNames>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFSharpCoreVersion>4.4.1.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>AED</Name>
<WarningLevel>3</WarningLevel>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Deterministic>true</Deterministic>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Name>AED</Name>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
Expand Down
7 changes: 2 additions & 5 deletions src/Acoustics.Shared.FSharp/Acoustics.Shared.FSharp.fsproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Acoustics.Shared.FSharp</RootNamespace>
<AssemblyName>Acoustics.Shared.FSharp</AssemblyName>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFSharpCoreVersion>4.4.1.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>Acoustics.Shared.FSharp</Name>
<WarningLevel>3</WarningLevel>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
Expand Down
Loading

0 comments on commit 5a32882

Please sign in to comment.