Skip to content

Commit

Permalink
Merge pull request #42 from richardschneider/ci-upgrade
Browse files Browse the repository at this point in the history
CI/CD enhancements
  • Loading branch information
richardschneider committed Jul 4, 2019
2 parents 980cfff + 362d953 commit 7384ded
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 152 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: csharp
mono: none
dotnet: 2.0.0
dist: trusty
dist: xenial
dotnet: 2.2.300
sudo: required
os:
- linux
Expand All @@ -12,4 +12,4 @@ install:

script:
- dotnet build -c Release --no-restore --framework netstandard2 ./src
- dotnet test -c Release --no-restore --framework netcoreapp2 ./test
- dotnet test -c Release --no-restore --framework netcoreapp2.1 ./test
40 changes: 19 additions & 21 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,46 +32,44 @@ environment:
# tools we need for bulding/testing/deploying
install:
- choco install gitversion.portable -y
- choco install docfx -y
- npm install gh-pages -g

# gitversion will change the assembly info
pull_requests:
do_not_increment_build_number: true

before_build:
- nuget restore
- ps: gitversion /output buildserver /updateAssemblyInfo >gitversion.log

build_script:
- dotnet build -c %CONFIGURATION% -p:Version=%GitVersion_MajorMinorPatch% -p:AssemblyVersion=%GitVersion_MajorMinorPatch%
- dotnet pack -c %CONFIGURATION% --no-build --no-restore -p:Version=%GitVersion_MajorMinorPatch% -p:AssemblyVersion=%GitVersion_MajorMinorPatch%

after_build:
- cmd: appveyor PushArtifact "src\bin\%CONFIGURATION%\Makaretu.Dns.%GitVersion_MajorMinorPatch%.nupkg"
# Build documentation in doc\_site
- choco install docfx -y
- docfx doc\docfx.json --logLevel Warning --warningsAsErrors
- 7z a -tzip docs.zip doc\_site
- appveyor PushArtifact docs.zip
- if defined git_token gh-pages -d doc\_site -m "new docs %GitVersion_FullSemVer%"

test_script:
- dotnet test -c %CONFIGURATION% --no-build --no-restore test

after_test:
# Generate coverage report
- packages\OpenCover.4.6.519\tools\OpenCover.Console.exe
-register:user -filter:"+[Makaretu.Dns*]* -[*Tests]*"
-target:"c:\Program Files\dotnet\dotnet.exe"
-targetargs:"test -c Release --no-build --no-restore --framework net45 test"
-output:coverage.xml
-mergeoutput
-hideskipped:File
-oldStyle
- if defined COVERALLS_REPO_TOKEN
packages\coveralls.net.0.6.0\tools\csmacnz.coveralls.exe
--opencover -i ./coverage.xml --useRelativePaths --serviceName appveyor --jobId %APPVEYOR_BUILD_NUMBER%
# Build documentation in doc\_site
- del src\obj\*.* /s /q
- docfx doc\docfx.json --logLevel Warning
- 7z a -tzip docs.zip doc\_site
- appveyor PushArtifact docs.zip
- if defined git_token gh-pages -d doc\_site -m "new docs %GitVersion_FullSemVer%"
- dotnet test -c %CONFIGURATION% -f netcoreapp2.1 --no-build --no-restore test /p:CollectCoverage=true
- choco install codecov -y
- codecov -f "test/coverage.opencover.xml"
- dotnet tool install --global coveralls.net --version 1.0.0
- if defined COVERALLS_REPO_TOKEN
csmacnz.coveralls.exe
--opencover -i test/coverage.opencover.xml --useRelativePaths --serviceName appveyor --jobId %APPVEYOR_BUILD_NUMBER%

artifacts:
- path: 'src/**/*.nupkg'
name: nupkg
- path: 'src/**/*.snupkg'
name: snupkg

# publish NuGet package on tag build
nuget:
Expand Down
112 changes: 0 additions & 112 deletions doc/MSBuild.dll.config

This file was deleted.

7 changes: 0 additions & 7 deletions doc/packages.config

This file was deleted.

23 changes: 18 additions & 5 deletions src/Dns.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<TargetFrameworks>net472;net45;netstandard14;netstandard2</TargetFrameworks>
<AssemblyName>Makaretu.Dns</AssemblyName>
<RootNamespace>Makaretu.Dns</RootNamespace>
<DocumentationFile>Makaretu.Dns.xml</DocumentationFile>
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<!-- developer build is always 0.42 -->
<AssemblyVersion>0.42.1</AssemblyVersion>
<Version>0.42.1</Version>
<AssemblyVersion>0.42</AssemblyVersion>
<Version>0.42</Version>

<!-- Nuget specs -->
<PackageId>Makaretu.Dns</PackageId>
Expand All @@ -22,16 +21,30 @@
<Copyright>© 2018-2019 Richard Schneider</Copyright>
<PackageTags>dns</PackageTags>
<IncludeSymbols>True</IncludeSymbols>
<PackageLicenseUrl>https://github.com/richardschneider/net-dns/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/richardschneider/net-dns</PackageProjectUrl>

<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>false</EmbedUntrackedSources>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb;$(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard14'">
<DefineConstants>NETSTANDARD14</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SimpleBase" Version="1.3.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19351-01" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 13 additions & 4 deletions test/DnsTests.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net45;netcoreapp2;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net472;net45;netcoreapp2.1;netcoreapp1.1</TargetFrameworks>

<IsPackable>false</IsPackable>
<DebugType>full</DebugType>
<RootNamespace>Makaretu.Dns</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<!-- https://github.com/tonerdo/coverlet -->
<!-- Do not collect by default -->
<CollectCoverage>false</CollectCoverage>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<!--<Exclude>[xunit.*]*</Exclude>-->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" PrivateAssets="all" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" PrivateAssets="all" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" PrivateAssets="all" />
<PackageReference Include="coverlet.msbuild" Version="2.6.2" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 7384ded

Please sign in to comment.