mirror of https://github.com/SixLabors/ImageSharp
13 changed files with 43 additions and 403 deletions
@ -1,43 +0,0 @@ |
|||
language: csharp |
|||
solution: ImageSharp.sln |
|||
|
|||
matrix: |
|||
include: |
|||
- os: linux # Ubuntu 16.04 |
|||
dist: xenial |
|||
sudo: required |
|||
dotnet: 2.1.603 |
|||
mono: latest |
|||
# - os: osx # OSX 10.11 |
|||
# osx_image: xcode7.3.1 |
|||
# dotnet: 1.0.0-preview2-003121 |
|||
# mono: latest |
|||
|
|||
branches: |
|||
only: |
|||
- master |
|||
- coverity_scan |
|||
|
|||
script: |
|||
- git submodule -q update --init |
|||
- dotnet restore |
|||
- dotnet test tests/ImageSharp.Tests/ImageSharp.Tests.csproj -c Release -f "netcoreapp2.1" |
|||
|
|||
env: |
|||
global: |
|||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created |
|||
# via the "travis encrypt" command using the project repo's public key |
|||
- secure: "rjMvEMN9rpvIXqXqCAAKzbHyABzr7E4wPU/dYJ/mHBqlCccFpQrEXVVM1MfRFXYuWZSaIioknhLATZjT5xvIYpTNM6D57z4OTmqeRHhYm80=" |
|||
|
|||
before_install: |
|||
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- |
|||
|
|||
addons: |
|||
coverity_scan: |
|||
project: |
|||
name: "SixLabors/ImageSharp" |
|||
description: "Build submitted via Travis CI" |
|||
notification_email: james_south@hotmail.com |
|||
build_command_prepend: "dotnet restore" |
|||
build_command: "dotnet build -c Release" |
|||
branch_pattern: coverity_scan |
|||
@ -1,22 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RunSettings> |
|||
<DataCollectionRunSettings> |
|||
<DataCollectors> |
|||
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|||
<Configuration> |
|||
<CodeCoverage> |
|||
<ModulePaths> |
|||
<Include> |
|||
<ModulePath>.*ImageSharp.dll</ModulePath> |
|||
</Include> |
|||
<Exclude> |
|||
<ModulePath>.*tests*</ModulePath> |
|||
<ModulePath>.*Tests*</ModulePath> |
|||
</Exclude> |
|||
</ModulePaths> |
|||
</CodeCoverage> |
|||
</Configuration> |
|||
</DataCollector> |
|||
</DataCollectors> |
|||
</DataCollectionRunSettings> |
|||
</RunSettings> |
|||
@ -1,67 +0,0 @@ |
|||
version: 1.0.0.{build} |
|||
image: Visual Studio 2017 |
|||
|
|||
# prevent the double build when a branch has an active PR |
|||
skip_branch_with_pr: true |
|||
|
|||
environment: |
|||
matrix: |
|||
- target_framework: netcoreapp2.1 |
|||
is_32bit: False |
|||
|
|||
- target_framework: netcoreapp2.1 |
|||
is_32bit: True |
|||
|
|||
- target_framework: net472 |
|||
is_32bit: False |
|||
|
|||
- target_framework: net472 |
|||
is_32bit: True |
|||
|
|||
- target_framework: net462 |
|||
is_32bit: False |
|||
|
|||
- target_framework: net462 |
|||
is_32bit: True |
|||
|
|||
#- target_framework: mono |
|||
# is_32bit: False |
|||
#- target_framework: mono |
|||
# is_32bit: True |
|||
#- target_framework: net47 |
|||
# is_32bit: False |
|||
#- target_framework: net47 |
|||
# is_32bit: True |
|||
|
|||
install: |
|||
- ps: | |
|||
if ($env:target_framework -eq "mono") { |
|||
if ($env:is_32bit -eq "True") { |
|||
cinst mono --x86 |
|||
} else { |
|||
cinst mono |
|||
} |
|||
} |
|||
|
|||
before_build: |
|||
- git submodule -q update --init |
|||
- cmd: dotnet --info |
|||
|
|||
build_script: |
|||
- cmd: build.cmd |
|||
|
|||
test_script: |
|||
- ps: .\run-tests.ps1 $env:target_framework $env:is_32bit |
|||
|
|||
after_test: |
|||
- cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%APPVEYOR_BUILD_VERSION%.nupkg" |
|||
# deploy: |
|||
# # MyGet Deployment for builds & releases |
|||
# - provider: NuGet |
|||
# server: https://www.myget.org/F/sixlabors/api/v2/package |
|||
# symbol_server: https://www.myget.org/F/sixlabors/symbols/api/v2/package |
|||
# api_key: |
|||
# secure: V/lEHP0UeMWIpWd0fiNlY2IgbCnJKQlGdRksECdJbOBdaE20Fl0RNL7WyqHe02o4 |
|||
# artifact: /.*\.nupkg/ |
|||
# on: |
|||
# branch: master |
|||
@ -1,150 +0,0 @@ |
|||
param( |
|||
[string]$targetFramework = 'ALL' |
|||
) |
|||
|
|||
# Lets calculate the correct version here |
|||
$fallbackVersion = "1.0.0"; |
|||
$version = '' |
|||
|
|||
$tagRegex = '^v?(\d+\.\d+\.\d+)(?:-([a-zA-Z]+)\.?(\d*))?$' |
|||
|
|||
function ToBuildNumber { |
|||
param( $date ) |
|||
|
|||
if ("$date" -eq "") { |
|||
$date = [System.DateTime]::Now |
|||
} |
|||
|
|||
if ($date.GetType().fullname -ne 'System.DateTime') { |
|||
$date = [System.DateTime]::Parse($date) |
|||
} |
|||
|
|||
return $date.ToString("yyyyMMddhhmmss") |
|||
} |
|||
|
|||
# We are running on the build server |
|||
$isVersionTag = "$env:GITHUB_REF".replace("refs/tags/", "") -match $tagRegex |
|||
|
|||
if ($isVersionTag) { |
|||
Write-Debug "Github tagged build" |
|||
} |
|||
|
|||
if ($isVersionTag -eq $false) { |
|||
if ( "$(git diff --stat)" -eq '') { |
|||
Write-Debug "Clean repo" |
|||
if ("$(git tag --list)" -ne "") { |
|||
Write-Debug "Has tags" |
|||
$tagData = (git describe --tags HEAD) |
|||
$isVersionTag = $tagData -match $tagRegex |
|||
Write-Debug $tagData |
|||
} |
|||
} |
|||
else { |
|||
Write-Debug "Dirty repo" |
|||
} |
|||
} |
|||
|
|||
if ($isVersionTag) { |
|||
|
|||
Write-Debug "Building commit tagged with a compatable version number" |
|||
|
|||
$version = $matches[1] |
|||
$postTag = $matches[2] |
|||
$count = $matches[3] |
|||
|
|||
Write-Debug "Version number: ${version} post tag: ${postTag} count: ${count}" |
|||
|
|||
if ("$postTag" -ne "") { |
|||
$version = "${version}-${postTag}" |
|||
} |
|||
|
|||
if ("$count" -ne "") { |
|||
# For consistancy with previous releases we pad the counter to only 4 places |
|||
$padded = $count.Trim().PadLeft(4, "0"); |
|||
Write-Debug "count '$count', padded '${padded}'" |
|||
|
|||
$version = "${version}${padded}" |
|||
} |
|||
} |
|||
else { |
|||
|
|||
Write-Debug "Untagged" |
|||
$lastTag = (git tag --list --sort=-taggerdate) | Out-String |
|||
$list = $lastTag.Split("`n") |
|||
foreach ($tag in $list) { |
|||
|
|||
Write-Debug "Testing ${tag}" |
|||
$tag = $tag.Trim(); |
|||
if ($tag -match $tagRegex) { |
|||
Write-Debug "Matched ${tag}" |
|||
$version = $matches[1]; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
if ("$version" -eq "") { |
|||
$version = $fallbackVersion |
|||
Write-Debug "Failed to discover base version Fallback to '${version}'" |
|||
} |
|||
else { |
|||
|
|||
Write-Debug "Discovered base version from tags '${version}'" |
|||
} |
|||
|
|||
# Create a build number based on the current datetime. |
|||
$buildNumber = "" |
|||
|
|||
if ( "$env:GITHUB_SHA" -ne '') { |
|||
$buildNumber = ToBuildNumber (git show -s --format=%ci $env:GITHUB_SHA) |
|||
} |
|||
elseif ( "$(git diff --stat)" -eq '') { |
|||
$buildNumber = ToBuildNumber (git show -s --format=%ci HEAD) |
|||
} |
|||
else { |
|||
$buildNumber = ToBuildNumber |
|||
} |
|||
|
|||
$buildNumber = "$buildNumber".Trim().PadLeft(12, "0"); |
|||
|
|||
Write-Debug "Building a branch commit" |
|||
|
|||
# This is a general branch commit |
|||
$branch = ((git rev-parse --abbrev-ref HEAD) | Out-String).Trim() |
|||
|
|||
if ("$branch" -eq "") { |
|||
$branch = "unknown" |
|||
} |
|||
|
|||
$branch = $branch.Replace("/", "-").ToLower() |
|||
|
|||
if ($branch.ToLower() -eq "master" -or $branch.ToLower() -eq "head") { |
|||
$branch = "dev" |
|||
} |
|||
|
|||
$version = "${version}-${branch}${buildNumber}"; |
|||
} |
|||
|
|||
Write-Host "Building version '${version}'" |
|||
|
|||
if ($targetFramework -ne 'ALL') { |
|||
$targetFramework = "-f $targetFramework" |
|||
} |
|||
|
|||
# dotnet restore $targetFramework /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true |
|||
|
|||
$repositoryUrl = "" |
|||
|
|||
if ("$env:GITHUB_REPOSITORY" -ne "") { |
|||
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY" |
|||
} |
|||
|
|||
Write-Host "Building projects" |
|||
|
|||
dotnet build -c Release ${$targetFramework} /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl |
|||
|
|||
if ($LASTEXITCODE ) { Exit $LASTEXITCODE } |
|||
|
|||
# Write-Host "Packaging projects" |
|||
|
|||
# dotnet pack -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl |
|||
# if ($LASTEXITCODE ) { Exit $LASTEXITCODE } |
|||
@ -0,0 +1,19 @@ |
|||
param( |
|||
[Parameter(Mandatory, Position = 0)] |
|||
[string]$version, |
|||
[string]$targetFramework = 'ALL' |
|||
) |
|||
|
|||
dotnet clean -c Release |
|||
|
|||
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY" |
|||
if ($targetFramework -ne 'ALL') { |
|||
|
|||
# Building for a specific framework. |
|||
dotnet build -c Release -f $targetFramework /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl |
|||
} |
|||
else { |
|||
|
|||
# Building for packing and publishing. |
|||
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl |
|||
} |
|||
@ -1,4 +0,0 @@ |
|||
ignore: |
|||
"src/ImageSharp/Common/Helpers/DebugGuard.cs" |
|||
|
|||
|
|||
@ -1,21 +0,0 @@ |
|||
@echo off |
|||
|
|||
|
|||
cd tests\CodeCoverage |
|||
|
|||
nuget restore packages.config -PackagesDirectory . |
|||
|
|||
cd .. |
|||
cd .. |
|||
|
|||
dotnet restore ImageSharp.sln |
|||
rem Clean the solution to force a rebuild with /p:codecov=true |
|||
dotnet clean ImageSharp.sln -c Release |
|||
rem The -threshold options prevents this taking ages... |
|||
tests\CodeCoverage\OpenCover.4.7.922\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c Release -f netcoreapp2.1 /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*" |
|||
|
|||
if %errorlevel% neq 0 exit /b %errorlevel% |
|||
|
|||
SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH% |
|||
pip install codecov |
|||
codecov -f "ImageSharp.Coverage.xml" |
|||
@ -1,11 +0,0 @@ |
|||
|
|||
if((Test-Path("$PSScriptRoot\OpenCover.4.6.519")) -eq $false){ |
|||
Invoke-WebRequest https://www.nuget.org/api/v2/package/OpenCover/4.7.922 -OutFile "$PSScriptRoot\opencover.zip" |
|||
[IO.Compression.Zipfile]::ExtractToDirectory("$PSScriptRoot\opencover.zip","$PSScriptRoot\OpenCover.4.6.519") |
|||
} |
|||
|
|||
dotnet clean ImageSharp.sln -c Release |
|||
|
|||
& "$PSScriptRoot\OpenCover.4.6.519\tools\OpenCover.Console.exe" -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c Release -f netcoreapp2.1 /p:skipFullFramework=true /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*" |
|||
|
|||
if ($LASTEXITCODE ){ Exit $LASTEXITCODE } |
|||
@ -1,4 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="OpenCover" version="4.6.519" /> |
|||
</packages> |
|||
Loading…
Reference in new issue