From 5e09c7d8bfb222f30eca96b4fb080bc6cb00e7c8 Mon Sep 17 00:00:00 2001 From: Mohamed Hassan Date: Thu, 12 Mar 2020 20:20:58 +0200 Subject: [PATCH] Add Linux as CI in appveyor (#598) --- CHANGELOG.md | 3 +- README.md | 7 +- appveyor.yml | 71 ++++++++++++------- .../Fakes/HelpTextWithLineBreaks_Options.cs | 2 +- .../Unit/UnParserExtensionsTests.cs | 4 +- 5 files changed, 54 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ede9176a..526e3095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. CommandLineParser project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.8.0-preview1] - 2020-3-12 +## [2.8.0-preview1] - 2020-3-14 ### Added - Added support for async programming for `WithParsed and WithNotParsed` by [@joseangelmt, PR# 390 ](https://github.com/commandlineparser/commandline/pull/390). @@ -11,6 +11,7 @@ CommandLineParser project adheres to [Semantic Versioning](https://semver.org/sp - Add more details for localized attribute properties by [@EdmondShtogu, PR# 558](https://github.com/commandlineparser/commandline/pull/558) - Support Default in Group Options and raise error if both SetName and Group are applied on option by [@hadzhiyski, PR# 575](https://github.com/commandlineparser/commandline/pull/575). - Support mutable types without empty constructor that only does explicit implementation of interfaces by [@pergardebrink](https://github.com/commandlineparser/commandline/pull/590). +- ### Changed - Tests cleanup by [@gsscoder, PR# 560](https://github.com/commandlineparser/commandline/pull/560). diff --git a/README.md b/README.md index 75901a63..aa1145e5 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ __This library provides _hassle free_ command line parsing with a constantly upd - Verbs can be array of types collected from Plugins or IoC container. - Define [verb commands](https://github.com/commandlineparser/commandline/wiki/Verbs) similar to `git commit -a`. - Support default verb. -- Support Mutable and Imutable types. +- Support Mutable and Immutable types. - Support HelpText localization. - Support ordering of options in HelpText. - Support [Mutually Exclusive Options](https://github.com/commandlineparser/commandline/wiki/Mutually-Exclusive-Options) and Options groups. @@ -38,8 +38,9 @@ __This library provides _hassle free_ command line parsing with a constantly upd - Support Asynchronous programming with async and await. - Unparsing support: `CommandLine.Parser.Default.FormatCommandLine(T options)`. - CommandLineParser.FSharp package is F#-friendly with support for `option<'a>`, see [demo](https://github.com/commandlineparser/commandline/blob/master/demo/fsharp-demo.fsx). _NOTE: This is a separate NuGet package._ -- Include good wiki documentation with lot of examples ready to run online. -- Support Sourcelink and symbolic package. +- Include wiki documentation with lot of examples ready to run online. +- Support Source Link and symbolic nuget package snupkg. +- Tested in Windows, Linux Ubuntu 18.04 and Mac OS. - Most of features applies with a [CoC](http://en.wikipedia.org/wiki/Convention_over_configuration) philosophy. - C# demo: source [here](https://github.com/commandlineparser/commandline/tree/master/demo/ReadText.Demo). diff --git a/appveyor.yml b/appveyor.yml index 283a785c..ec43f10e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,9 @@ #version should be only changed with RELEASE eminent, see RELEASE.md version: 2.8.0-ci-{build} -image: Visual Studio 2019 +image: + - Visual Studio 2019 + - ubuntu1804 clone_depth: 1 pull_requests: @@ -10,24 +12,31 @@ pull_requests: init: - ps: | git config --global core.autocrlf input - + $env:CAN_PUBLISH = $true if ($env:APPVEYOR_REPO_TAG -eq "true") { $ver = $env:APPVEYOR_REPO_TAG_NAME if($ver.StartsWith("v") -eq $true) { $ver = $ver.Substring(1) } - $env:PACKAGE_VERSION = $ver - } else { - $env:PACKAGE_VERSION = $env:APPVEYOR_BUILD_VERSION + try + { + Update-AppveyorBuild -Version $ver + } + catch + { + Write-Output "Update-AppveyorBuild Fail to change version to TAG: '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Red + Write-Output "Exception Error: $PSItem.Exception.Message" -ForegroundColor Red + $env:CAN_PUBLISH = $false + } } + - ps: | - Write-Host "PACKAGE_VERSION:$env:PACKAGE_VERSION | APPVEYOR_BUILD_VERSION='$env:APPVEYOR_BUILD_VERSION'" -ForegroundColor Yellow - Write-Host "APPVEYOR_REPO_TAG_NAME:$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Yellow + Write-Host "APPVEYOR_BUILD_VERSION='$env:APPVEYOR_BUILD_VERSION'" -ForegroundColor Yellow + Write-Host "APPVEYOR_REPO_TAG_NAME= '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Yellow skip_commits: files: - docs/* - art/* - - '**/*.md' - #- .travis.yml + - '**/*.md' - .gitignore - .editorconfig message: /updated readme.*|update readme.*s|update docs.*|update version.*|update changelog.*/ @@ -38,13 +47,16 @@ environment: - BUILD_TARGET: fsharp build_script: -- cmd: dotnet build src/CommandLine/ -c Release --version-suffix %PACKAGE_VERSION% /p:BuildTarget=%BUILD_TARGET% +- cmd: dotnet build src/CommandLine/ -c Release --version-suffix %APPVEYOR_BUILD_VERSION% /p:BuildTarget=%BUILD_TARGET% +- sh: dotnet build src/CommandLine/ -c Release --version-suffix $APPVEYOR_BUILD_VERSION /p:BuildTarget=$BUILD_TARGET test_script: - cmd: dotnet test tests/CommandLine.Tests/ /p:BuildTarget=%BUILD_TARGET% +- sh: dotnet test tests/CommandLine.Tests/ /p:BuildTarget=$BUILD_TARGET -f netcoreapp2.0 after_test: -- cmd: dotnet pack src/CommandLine/ -c Release --version-suffix %PACKAGE_VERSION% /p:BuildTarget=%BUILD_TARGET% +- cmd: dotnet pack src/CommandLine/ -c Release --version-suffix %APPVEYOR_BUILD_VERSION% /p:BuildTarget=%BUILD_TARGET% +- sh: dotnet pack src/CommandLine/ -c Release --version-suffix $APPVEYOR_BUILD_VERSION /p:BuildTarget=$BUILD_TARGET artifacts: - path: 'src/CommandLine/bin/Release/*.nupkg' @@ -56,20 +68,27 @@ on_failure: tree /f /a >files.lst appveyor PushArtifact .\files.lst -DeploymentName "Failed Build File Listing" -deploy: -- provider: GitHub - auth_token: - secure: hVyVwHl0JiVq0VxXB4VMRWbUtrGclIzadfnWFcWCQBLvbgMLahLBnWlwGglT63pZ - artifact: 'NuGetPackages' - prerelease: false - force_update: true #fsharp package runs as separate build job, so have to force_update to add fsharp.nuget added - on: - APPVEYOR_REPO_TAG: true +for: +- + matrix: + only: + - image: Visual Studio 2019 + deploy: + - provider: GitHub + auth_token: + secure: hVyVwHl0JiVq0VxXB4VMRWbUtrGclIzadfnWFcWCQBLvbgMLahLBnWlwGglT63pZ + artifact: /.*(\.|\.s)nupkg/ + prerelease: false + force_update: true #fsharp package runs as separate build job, so have to force_update to add fsharp.nuget added + on: + APPVEYOR_REPO_TAG: true + CAN_PUBLISH: true -- provider: NuGet - api_key: - secure: Ab4T/48EyIJhVrqkfKdUxmHUtseEVuXuyrGACxZ0KN35rb/BzABlBM2YjZojicvT - artifact: 'NuGetPackages' - on: - APPVEYOR_REPO_TAG: true + - provider: NuGet + api_key: + secure: Ab4T/48EyIJhVrqkfKdUxmHUtseEVuXuyrGACxZ0KN35rb/BzABlBM2YjZojicvT + artifact: 'NuGetPackages' + on: + APPVEYOR_REPO_TAG: true + CAN_PUBLISH: true diff --git a/tests/CommandLine.Tests/Fakes/HelpTextWithLineBreaks_Options.cs b/tests/CommandLine.Tests/Fakes/HelpTextWithLineBreaks_Options.cs index c93e73aa..b8974ca7 100644 --- a/tests/CommandLine.Tests/Fakes/HelpTextWithLineBreaks_Options.cs +++ b/tests/CommandLine.Tests/Fakes/HelpTextWithLineBreaks_Options.cs @@ -10,7 +10,7 @@ public class HelpTextWithLineBreaks_Options [Option(HelpText = @"This is a help text description where we want - The left pad after a linebreak to be honoured so that + the left pad after a linebreak to be honoured so that we can sub-indent within a description.")] public string StringValu2 { get; set; } diff --git a/tests/CommandLine.Tests/Unit/UnParserExtensionsTests.cs b/tests/CommandLine.Tests/Unit/UnParserExtensionsTests.cs index 3edb8f20..2c95e893 100644 --- a/tests/CommandLine.Tests/Unit/UnParserExtensionsTests.cs +++ b/tests/CommandLine.Tests/Unit/UnParserExtensionsTests.cs @@ -207,8 +207,8 @@ public static void UnParsing_instance_with_int_nullable(bool skipDefault, int? v } [Theory] - [InlineData(Shapes.Circle, "--shape circle")] - [InlineData(Shapes.Square, "--shape square")] + [InlineData(Shapes.Circle, "--shape Circle")] + [InlineData(Shapes.Square, "--shape Square")] [InlineData(null, "")] public static void UnParsing_instance_with_nullable_enum(Shapes? shape, string expected) {