From 2ef3b90b533b84dac14fcf1d642361c24e71c75a Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sun, 17 Nov 2019 11:52:42 +0000 Subject: [PATCH 01/53] enable using github actions for building + publish to github package repository --- .github/workflows/build-and-test.yml | 116 ++++++++++++++++++ .gitignore | 2 + Directory.Build.props | 2 +- build.ps1 | 100 +++++++++++++-- run-tests.ps1 | 7 +- src/ImageSharp/ImageSharp.csproj | 5 +- tests/CodeCoverage/CodeCoverage.ps1 | 11 ++ .../ImageSharp.Benchmarks.csproj | 5 +- .../ImageSharp.Sandbox46.csproj | 7 +- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 5 +- 10 files changed, 238 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 tests/CodeCoverage/CodeCoverage.ps1 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000000..b4a194bc58 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,116 @@ +name: Build + +on: + push: + branches: + - master + tags: + - 'v*' + pull_request: + branches: + - master + +jobs: + Coverage: + runs-on: windows-latest + needs: [Build] + steps: + - uses: actions/checkout@v1 + + - name: Enable long file paths + run: git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init + + - name: Generate Test Coverage + shell: pwsh + run: ./tests/CodeCoverage/CodeCoverage.ps1 + env: + CI : True + + - name: Update codecov + uses: iansu/codecov-action-node@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: "ImageSharp.Coverage.xml" + flags: unittests + + Build: + strategy: + matrix: + options: + - os : ubuntu-latest + framework: netcoreapp2.1 + is32Bit: False + - os : windows-latest + framework: netcoreapp2.1 + is32Bit: False + - os : windows-latest + framework: net472 + is32Bit: False + - os : windows-latest + framework: net472 + is32Bit: True + + runs-on: ${{ matrix.options.os }} + + steps: + - uses: actions/checkout@v1 + + - name: Enable long file paths + run: | + git config --global core.autocrlf false + git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init + + - name: Build + shell: pwsh + run: | + $DebugPreference = "Continue" + ./build.ps1 "${{matrix.options.framework}}" + + - name: Test + shell: pwsh + run: ./run-tests.ps1 "${{matrix.options.framework}}" "${{matrix.options.is32Bit}}" true + env: + CI : True + + Publish: + runs-on: windows-latest + needs: [Build] + if : github.event_name == 'push' + steps: + - uses: actions/checkout@v1 + + - name: Enable long file paths + run: git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init + + - name: Build + shell: pwsh + run: | + $DebugPreference = "Continue" + ./build.ps1 + + - name : install nuget + if: success() + uses: warrenbuckley/Setup-Nuget@v1 + + - name: Configure feed + if: success() + run: nuget.exe source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/sixlabors/index.json" -UserName ${{github.actor}} -Password ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to nightly feed - github + if: success() + run: nuget.exe push -Source "GitHub" .\artifacts\*.nupkg + + - name: Publish to nightly feed -myget + if: success() + run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package + + # todo if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org \ No newline at end of file diff --git a/.gitignore b/.gitignore index d8f376a419..4007b1faba 100644 --- a/.gitignore +++ b/.gitignore @@ -221,3 +221,5 @@ artifacts/ # Tests **/Images/ActualOutput **/Images/ReferenceOutput +/tests/CodeCoverage/opencover.zip +/tests/CodeCoverage/OpenCover.4.6.519 diff --git a/Directory.Build.props b/Directory.Build.props index efe4cc9665..e865a83f85 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,7 +14,7 @@ $(MSBuildThisFileDirectory)artifacts/ $(ImageSharpProjectCategory)/$(MSBuildProjectName) - https://github.com/SixLabors/ImageSharp/ + https://github.com/SixLabors/ImageSharp/ diff --git a/build.ps1 b/build.ps1 index 215b551170..1bc7ff6cc1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,20 +1,79 @@ +param( + [string]$targetFramework = 'ALL' +) # lets calulat the correct version here $fallbackVersion = "1.0.0"; $version = '' -$tagRegex = '^v?(\d+\.\d+\.\d+)(-([a-zA-Z]+)\.?(\d*))?$' +$tagRegex = '^v?(\d+\.\d+\.\d+)(?:-([a-zA-Z]+)\.?(\d*))?$' + +$skipFullFramework = 'false' + +# if we are trying to build only netcoreapp versions for testings then skip building the full framework targets +if("$targetFramework".StartsWith("netcoreapp")){ + $skipFullFramework = 'true' +} + +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") +} + +# if($IsWindows){ +# $skipFullFramework = 'true' +# Write-Info "Building full framework targets - Running windows" +# }else{ +# if (Get-Command "mono" -ErrorAction SilentlyContinue) +# { +# Write-Info "Building full framework targets - mono installed" +# $skipFullFramework = 'true' +# } +# } # we are running on the build server $isVersionTag = $env:APPVEYOR_REPO_TAG_NAME -match $tagRegex +if($isVersionTag -eq $false){ + $isVersionTag = "$env:GITHUB_REF".replace("refs/tags/", "") -match $tagRegex + if($isVersionTag){ + Write-Debug "Github tagged build" + } +}else{ + Write-Debug "Appveyor 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[3] - $count = $matches[4] + $postTag = $matches[2] + $count = $matches[3] Write-Debug "version number: ${version} post tag: ${postTag} count: ${count}" if("$postTag" -ne ""){ $version = "${version}-${postTag}" @@ -53,8 +112,23 @@ $isVersionTag = $env:APPVEYOR_REPO_TAG_NAME -match $tagRegex $buildNumber = $env:APPVEYOR_BUILD_NUMBER - # build number replacement is padded to 6 places - $buildNumber = "$buildNumber".Trim().Trim('0').PadLeft(6,"0"); + if("$buildNumber" -eq ""){ + # no counter availible in this environment + # let make one up based on time + + 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().Trim('0').PadLeft(12,"0"); + }else{ + # build number replacement is padded to 6 places + $buildNumber = "$buildNumber".Trim().Trim('0').PadLeft(6,"0"); + } + if("$env:APPVEYOR_PULL_REQUEST_NUMBER" -ne ""){ Write-Debug "building a PR" @@ -77,7 +151,7 @@ $isVersionTag = $env:APPVEYOR_REPO_TAG_NAME -match $tagRegex $branch = $branch.Replace("/","-").ToLower() - if($branch.ToLower() -eq "master"){ + if($branch.ToLower() -eq "master" -or $branch.ToLower() -eq "head"){ $branch = "dev" } @@ -94,10 +168,16 @@ if("$env:APPVEYOR_API_URL" -ne ""){ } Write-Host "Building version '${version}'" -dotnet restore /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true +dotnet restore /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true /p:skipFullFramework=$skipFullFramework + +$repositoryUrl = "https://github.com/SixLabors/ImageSharp/" + +if("$env:GITHUB_REPOSITORY" -ne ""){ + $repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY" +} Write-Host "Building projects" -dotnet build -c Release /p:packageversion=$version +dotnet build -c Release /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl if ($LASTEXITCODE ){ Exit $LASTEXITCODE } @@ -115,8 +195,8 @@ if ($LASTEXITCODE ){ Exit $LASTEXITCODE } if ($LASTEXITCODE ){ Exit $LASTEXITCODE } Write-Host "Packaging projects" -dotnet pack ./src/ImageSharp/ -c Release --output ../../artifacts --no-build /p:packageversion=$version +dotnet pack ./src/ImageSharp/ -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl if ($LASTEXITCODE ){ Exit $LASTEXITCODE } -dotnet pack ./src/ImageSharp.Drawing/ -c Release --output ../../artifacts --no-build /p:packageversion=$version +dotnet pack ./src/ImageSharp.Drawing/ -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl if ($LASTEXITCODE ){ Exit $LASTEXITCODE } diff --git a/run-tests.ps1 b/run-tests.ps1 index 4aeaa14908..2d563c67e6 100644 --- a/run-tests.ps1 +++ b/run-tests.ps1 @@ -1,6 +1,7 @@ param( [string]$targetFramework, - [string]$is32Bit = "False" + [string]$is32Bit = "False", + [string]$skipCodeCov = $false ) if (!$targetFramework){ @@ -41,9 +42,9 @@ function CheckSubmoduleStatus() { } -if ( ($targetFramework -eq "netcoreapp2.1") -and ($env:CI -eq "True") -and ($is32Bit -ne "True")) { +if ( ($targetFramework -eq "netcoreapp2.1") -and ($env:CI -eq "True") -and ($is32Bit -ne "True") -and $skipCodeCov -ne $true) { # We execute CodeCoverage.cmd only for one specific job on CI (netcoreapp2.1 + 64bit ) - $testRunnerCmd = ".\tests\CodeCoverage\CodeCoverage.cmd" + $testRunnerCmd = "./tests/CodeCoverage/CodeCoverage.ps1" } elseif ($targetFramework -eq "mono") { $testDllPath = "$PSScriptRoot\tests\ImageSharp.Tests\bin\Release\net462\SixLabors.ImageSharp.Tests.dll" diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 86b0848663..e0d70193fe 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -1,4 +1,4 @@ - + @@ -10,7 +10,8 @@ $(packageversion) 0.0.1 - netcoreapp2.1;netstandard1.3;netstandard2.0;net472 + netcoreapp2.1;netstandard1.3;netstandard2.0 + $(TargetFrameworks);net472 true true diff --git a/tests/CodeCoverage/CodeCoverage.ps1 b/tests/CodeCoverage/CodeCoverage.ps1 new file mode 100644 index 0000000000..b7073998f9 --- /dev/null +++ b/tests/CodeCoverage/CodeCoverage.ps1 @@ -0,0 +1,11 @@ + +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 } \ No newline at end of file diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index a57d388a95..ee0b2985f0 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -1,11 +1,12 @@ - + ImageSharp.Benchmarks Exe SixLabors.ImageSharp.Benchmarks - netcoreapp2.1;net472 + netcoreapp2.1 + $(TargetFrameworks);net472 false false diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj index fc94668e11..b0826dcbed 100644 --- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj +++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj @@ -1,4 +1,4 @@ - + @@ -8,7 +8,9 @@ false SixLabors.ImageSharp.Sandbox46 win7-x64 - net472 + netcoreapp2.1 + $(TargetFrameworks);net472 + SixLabors.ImageSharp.Sandbox46.Program @@ -18,6 +20,7 @@ + diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 1ac5f8085a..3bd5f6af2d 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -1,8 +1,9 @@ - + - netcoreapp2.1;net462;net472 + netcoreapp2.1 + $(TargetFrameworks);net462;net472 True latest full From 178f1d6c2f72c6024f57f2f60eec5d8b1b61c82e Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 11 Dec 2019 09:58:15 +0000 Subject: [PATCH 02/53] stop appveyor publishing pacakges --- appveyor.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2cc5182d39..07876c12f6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -57,13 +57,13 @@ after_test: - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%APPVEYOR_BUILD_VERSION%.nupkg" - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.Drawing.%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 \ No newline at end of file +# 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 \ No newline at end of file From 07f9a2c27d4a7b9e755100adab51cd99cfb0e69a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 12:32:58 +1100 Subject: [PATCH 03/53] Use dotnet test --- .github/workflows/build-and-test.yml | 208 ++++++++---------- .github/workflows/build-and-test.yml.bak | 116 ++++++++++ .vscode/launch.json | 28 --- .vscode/tasks.json | 31 --- Directory.Build.targets | 27 +-- ImageSharp.sln | 26 +-- build.ps1 | 128 ++++------- build/icons/imagesharp-logo-128.png | 3 - build/icons/imagesharp-logo-256.png | 3 - build/icons/imagesharp-logo-32.png | 3 - build/icons/imagesharp-logo-512.png | 3 - build/icons/imagesharp-logo-64.png | 3 - build/icons/imagesharp-logo.png | 3 - build/icons/imagesharp-logo.svg | 1 - run-tests.ps1 | 146 ++++++------ src/ImageSharp/ImageSharp.csproj | 4 - tests/CodeCoverage/CodeCoverage.cmd | 4 +- tests/Directory.Build.props | 6 + .../ImageSharp.Benchmarks.csproj | 5 - .../ImageSharp.Sandbox46.csproj | 6 +- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 8 - 21 files changed, 344 insertions(+), 418 deletions(-) create mode 100644 .github/workflows/build-and-test.yml.bak delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/tasks.json delete mode 100644 build/icons/imagesharp-logo-128.png delete mode 100644 build/icons/imagesharp-logo-256.png delete mode 100644 build/icons/imagesharp-logo-32.png delete mode 100644 build/icons/imagesharp-logo-512.png delete mode 100644 build/icons/imagesharp-logo-64.png delete mode 100644 build/icons/imagesharp-logo.png delete mode 100644 build/icons/imagesharp-logo.svg diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b4a194bc58..825c1f1cad 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,116 +1,98 @@ name: Build -on: - push: - branches: - - master - tags: - - 'v*' - pull_request: - branches: - - master - +on: + push: + branches: + - master + tags: + - "v*" + pull_request: + branches: + - master + jobs: - Coverage: - runs-on: windows-latest - needs: [Build] - steps: - - uses: actions/checkout@v1 - - - name: Enable long file paths - run: git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init - - - name: Generate Test Coverage - shell: pwsh - run: ./tests/CodeCoverage/CodeCoverage.ps1 - env: - CI : True - - - name: Update codecov - uses: iansu/codecov-action-node@v1.0.0 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: "ImageSharp.Coverage.xml" - flags: unittests - - Build: - strategy: - matrix: - options: - - os : ubuntu-latest - framework: netcoreapp2.1 - is32Bit: False - - os : windows-latest - framework: netcoreapp2.1 - is32Bit: False - - os : windows-latest - framework: net472 - is32Bit: False - - os : windows-latest - framework: net472 - is32Bit: True - - runs-on: ${{ matrix.options.os }} - - steps: - - uses: actions/checkout@v1 - - - name: Enable long file paths - run: | - git config --global core.autocrlf false - git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init - - - name: Build - shell: pwsh - run: | - $DebugPreference = "Continue" - ./build.ps1 "${{matrix.options.framework}}" - - - name: Test - shell: pwsh - run: ./run-tests.ps1 "${{matrix.options.framework}}" "${{matrix.options.is32Bit}}" true - env: - CI : True - - Publish: - runs-on: windows-latest - needs: [Build] - if : github.event_name == 'push' - steps: - - uses: actions/checkout@v1 - - - name: Enable long file paths - run: git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init - - - name: Build - shell: pwsh - run: | - $DebugPreference = "Continue" - ./build.ps1 - - - name : install nuget - if: success() - uses: warrenbuckley/Setup-Nuget@v1 - - - name: Configure feed - if: success() - run: nuget.exe source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/sixlabors/index.json" -UserName ${{github.actor}} -Password ${{ secrets.GITHUB_TOKEN }} - - - name: Publish to nightly feed - github - if: success() - run: nuget.exe push -Source "GitHub" .\artifacts\*.nupkg - - - name: Publish to nightly feed -myget - if: success() - run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package - - # todo if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org \ No newline at end of file + Build: + strategy: + matrix: + opts: + - os: ubuntu-latest + framework: netcoreapp2.1 + runtime: linux-x64 + cover: False + - os: windows-latest + framework: netcoreapp2.1 + runtime: win-x64 + cover: True + - os: windows-latest + framework: net472 + runtime: win-x64 + cover: False + - os: windows-latest + framework: net472 + runtime: win-x86 + cover: False + + runs-on: ${{ matrix.opts.os }} + + steps: + - uses: actions/checkout@v1 + + - name: Install nuget + uses: NuGet/setup-nuget@v1 + + - name: Enable long file paths + run: | + git config --global core.autocrlf false + git config --global core.longpaths true + + - name: Update Submodules + run: git submodule -q update --init --recursive + + - name: Build + shell: pwsh + run: | + $DebugPreference = "Continue" + ./build.ps1 "${{matrix.opts.framework}}" + + - name: Test no Coverage + if: matrix.opts.cover != 'True' + run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox + + - name: Test with Coverage + if: matrix.opts.cover == 'True' + run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + + - name: Update Codecov + uses: iansu/codecov-action-node@v1.0.0 + if: matrix.opts.cover == 'True' + with: + token: ${{secrets.CODECOV_TOKEN}} + file: "coverage.xml" + flags: unittests + + # Publish: + runs-on: windows-latest + needs: [Build] + if: github.event_name == 'push' + steps: + - uses: actions/checkout@v1 + + - name: install nuget + uses: NuGet/setup-nuget@v1 + + - name: Enable long file paths + run: git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init --recursive + + - name: Build + shell: pwsh + run: | + $DebugPreference = "Continue" + ./build.ps1 + + - name: Publish to nightly feed -myget + if: success() + run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package + # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org diff --git a/.github/workflows/build-and-test.yml.bak b/.github/workflows/build-and-test.yml.bak new file mode 100644 index 0000000000..7d7d2ad26b --- /dev/null +++ b/.github/workflows/build-and-test.yml.bak @@ -0,0 +1,116 @@ +name: Build + +on: + push: + branches: + - master + tags: + - "v*" + pull_request: + branches: + - master + +jobs: + Coverage: + runs-on: windows-latest + needs: [Build] + steps: + - uses: actions/checkout@v1 + + - name: Install nuget + uses: NuGet/setup-nuget@v1 + + - name: Enable long file paths + run: git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init --recursive + + - name: Generate Test Coverage + shell: pwsh + run: ./tests/CodeCoverage/CodeCoverage.ps1 + env: + CI: True + + - name: Update codecov + uses: iansu/codecov-action-node@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: "ImageSharp.Coverage.xml" + flags: unittests + + Build: + strategy: + matrix: + opts: + - os: ubuntu-latest + framework: netcoreapp2.1 + is32Bit: False + doCoverage: False + - os: windows-latest + framework: netcoreapp2.1 + is32Bit: False + doCoverage: True + - os: windows-latest + framework: net472 + is32Bit: False + doCoverage: False + - os: windows-latest + framework: net472 + is32Bit: True + doCoverage: False + + runs-on: ${{ matrix.opts.os }} + + steps: + - uses: actions/checkout@v1 + + - name: install nuget + uses: NuGet/setup-nuget@v1 + + - name: Enable long file paths + run: | + git config --global core.autocrlf false + git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init + + - name: Build + shell: pwsh + run: | + $DebugPreference = "Continue" + ./build.ps1 "${{matrix.opts.framework}}" + + - name: Test + shell: pwsh + run: ./run-tests.ps1 "${{ matrix.opts.os }}" "${{matrix.opts.framework}}" "${{matrix.opts.is32Bit}}" "${{matrix.opts.doCoverage}}" + env: + CI: True + + Publish: + runs-on: windows-latest + needs: [Build] + if: github.event_name == 'push' + steps: + - uses: actions/checkout@v1 + + - name: install nuget + uses: NuGet/setup-nuget@v1 + + - name: Enable long file paths + run: git config --global core.longpaths true + + - name: Update submodules + run: git submodule -q update --init --recursive + + - name: Build + shell: pwsh + run: | + $DebugPreference = "Continue" + ./build.ps1 + + - name: Publish to nightly feed -myget + if: success() + run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package + # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c772e647ce..0000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceRoot}/tests/ImageSharp.Benchmarks/bin/Debug/netcoreapp2.0/ImageSharp.Benchmarks.dll", - "args": [], - "cwd": "${workspaceRoot}/samples/AvatarWithRoundedCorner", - // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window - "console": "internalConsole", - "stopAtEntry": false, - "internalConsoleOptions": "openOnSessionStart" - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 82aaa2f8d0..0000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "0.1.0", - "command": "dotnet", - "isShellCommand": true, - "args": [], - "tasks": [ - { - "taskName": "build", - "args": [ "ImageSharp.sln" ], - "isBuildCommand": true, - "showOutput": "always", - "problemMatcher": "$msCompile" - }, - { - "taskName": "build benchmark", - "suppressTaskName": true, - "args": [ "build", "tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj", "-f", "netcoreapp2.0", "-c", "Release" ], - "showOutput": "always", - "problemMatcher": "$msCompile" - }, - { - "taskName": "test", - "args": ["tests/ImageSharp.Tests/ImageSharp.Tests.csproj", "-c", "release", "-f", "netcoreapp2.0"], - "isTestCommand": true, - "showOutput": "always", - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index f6523fee03..71dd9ab99a 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -15,33 +15,34 @@ $(DefineConstants);$(OS) - - - - - - - - + - - - + + - + + + + + + + + + + + - diff --git a/ImageSharp.sln b/ImageSharp.sln index 227512cd1f..6a80589d8f 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -36,25 +36,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM .github\ISSUE_TEMPLATE\feature-request.md = .github\ISSUE_TEMPLATE\feature-request.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".vscode", ".vscode", "{0274D4CF-9932-47CC-8E89-54DC05B8F06E}" - ProjectSection(SolutionItems) = preProject - .vscode\launch.json = .vscode\launch.json - .vscode\tasks.json = .vscode\tasks.json - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E919DF0B-2607-4462-8FC0-5C98FE50F8C9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "icons", "icons", "{2B02E303-7CC6-4E15-97EE-DBE86B287553}" - ProjectSection(SolutionItems) = preProject - build\icons\imagesharp-logo-128.png = build\icons\imagesharp-logo-128.png - build\icons\imagesharp-logo-256.png = build\icons\imagesharp-logo-256.png - build\icons\imagesharp-logo-32.png = build\icons\imagesharp-logo-32.png - build\icons\imagesharp-logo-512.png = build\icons\imagesharp-logo-512.png - build\icons\imagesharp-logo-64.png = build\icons\imagesharp-logo-64.png - build\icons\imagesharp-logo.png = build\icons\imagesharp-logo.png - build\icons\imagesharp-logo.svg = build\icons\imagesharp-logo.svg - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{815C0625-CD3D-440F-9F80-2D83856AB7AE}" ProjectSection(SolutionItems) = preProject src\Directory.Build.props = src\Directory.Build.props @@ -354,6 +335,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Benchmarks", "te EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{561B880A-D9EE-44EF-90F5-817C54A9D9AB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{C0D7754B-5277-438E-ABEB-2BA34401B5A7}" + ProjectSection(SolutionItems) = preProject + .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -418,7 +404,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {FBE8C1AD-5AEC-4514-9B64-091D8E145865} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D} - {2B02E303-7CC6-4E15-97EE-DBE86B287553} = {E919DF0B-2607-4462-8FC0-5C98FE50F8C9} {2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} {D4C5EC58-F8E6-4636-B9EE-C99D2578E5C6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {FA55F5DE-11A6-487D-ABA4-BC93A02717DD} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} @@ -438,6 +423,7 @@ Global {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {561B880A-D9EE-44EF-90F5-817C54A9D9AB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} + {C0D7754B-5277-438E-ABEB-2BA34401B5A7} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795} diff --git a/build.ps1 b/build.ps1 index e726fc30f9..e2c62c3d37 100644 --- a/build.ps1 +++ b/build.ps1 @@ -2,7 +2,7 @@ param( [string]$targetFramework = 'ALL' ) -# lets calulat the correct version here +# Lets calculate the correct version here $fallbackVersion = "1.0.0"; $version = '' @@ -10,13 +10,14 @@ $tagRegex = '^v?(\d+\.\d+\.\d+)(?:-([a-zA-Z]+)\.?(\d*))?$' $skipFullFramework = 'false' -# if we are trying to build only netcoreapp versions for testings then skip building the full framework targets +# If we are trying to build only netcoreapp versions for testings then skip building the full framework targets if ("$targetFramework".StartsWith("netcoreapp")) { $skipFullFramework = 'true' } function ToBuildNumber { param( $date ) + if ("$date" -eq "") { $date = [System.DateTime]::Now } @@ -25,32 +26,14 @@ function ToBuildNumber { $date = [System.DateTime]::Parse($date) } - return $date.ToString("yyyyMMddhhmmss") } -# if($IsWindows){ -# $skipFullFramework = 'true' -# Write-Info "Building full framework targets - Running windows" -# }else{ -# if (Get-Command "mono" -ErrorAction SilentlyContinue) -# { -# Write-Info "Building full framework targets - mono installed" -# $skipFullFramework = 'true' -# } -# } +# We are running on the build server +$isVersionTag = "$env:GITHUB_REF".replace("refs/tags/", "") -match $tagRegex -# we are running on the build server -$isVersionTag = $env:APPVEYOR_REPO_TAG_NAME -match $tagRegex - -if ($isVersionTag -eq $false) { - $isVersionTag = "$env:GITHUB_REF".replace("refs/tags/", "") -match $tagRegex - if ($isVersionTag) { - Write-Debug "Github tagged build" - } -} -else { - Write-Debug "Appveyor tagged build" +if ($isVersionTag) { + Write-Debug "Github tagged build" } if ($isVersionTag -eq $false) { @@ -75,13 +58,16 @@ if ($isVersionTag) { $version = $matches[1] $postTag = $matches[2] $count = $matches[3] - Write-Debug "version number: ${version} post tag: ${postTag} count: ${count}" + + 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().Trim('0').PadLeft(4, "0"); + # 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}" @@ -94,10 +80,10 @@ else { $list = $lastTag.Split("`n") foreach ($tag in $list) { - Write-Debug "testing ${tag}" + Write-Debug "Testing ${tag}" $tag = $tag.Trim(); if ($tag -match $tagRegex) { - Write-Debug "matched ${tag}" + Write-Debug "Matched ${tag}" $version = $matches[1]; break; } @@ -112,71 +98,43 @@ else { Write-Debug "Discovered base version from tags '${version}'" } - $buildNumber = $env:APPVEYOR_BUILD_NUMBER + # Create a build number based on the current time. + $buildNumber = "" - if ("$buildNumber" -eq "") { - # no counter availible in this environment - # let make one up based on time - - 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().Trim('0').PadLeft(12, "0"); + if ( "$env:GITHUB_SHA" -ne '') { + $buildNumber = ToBuildNumber (git show -s --format=%ci $env:GITHUB_SHA) } - else { - # build number replacement is padded to 6 places - $buildNumber = "$buildNumber".Trim().Trim('0').PadLeft(6, "0"); - } - - if ("$env:APPVEYOR_PULL_REQUEST_NUMBER" -ne "") { - Write-Debug "building a PR" - - $prNumber = "$env:APPVEYOR_PULL_REQUEST_NUMBER".Trim().Trim('0').PadLeft(5, "0"); - # this is a PR - $version = "${version}-PullRequest${prNumber}${buildNumber}"; + elseif ( "$(git diff --stat)" -eq '') { + $buildNumber = ToBuildNumber (git show -s --format=%ci HEAD) } else { - Write-Debug "building a branch commit" + $buildNumber = ToBuildNumber + } - # this is a general branch commit - $branch = $env:APPVEYOR_REPO_BRANCH + $buildNumber = "$buildNumber".Trim().PadLeft(12, "0"); - if ("$branch" -eq "") { - $branch = ((git rev-parse --abbrev-ref HEAD) | Out-String).Trim() + Write-Debug "Building a branch commit" - if ("$branch" -eq "") { - $branch = "unknown" - } - } + # This is a general branch commit + $branch = ((git rev-parse --abbrev-ref HEAD) | Out-String).Trim() - $branch = $branch.Replace("/", "-").ToLower() + if ("$branch" -eq "") { + $branch = "unknown" + } - if ($branch.ToLower() -eq "master" -or $branch.ToLower() -eq "head") { - $branch = "dev" - } + $branch = $branch.Replace("/", "-").ToLower() - $version = "${version}-${branch}${buildNumber}"; + if ($branch.ToLower() -eq "master" -or $branch.ToLower() -eq "head") { + $branch = "dev" } -} -if ("$env:APPVEYOR_API_URL" -ne "") { - # update appveyor build number for this build - Invoke-RestMethod -Method "PUT" ` - -Uri "${env:APPVEYOR_API_URL}api/build" ` - -Body "{version:'${version}'}" ` - -ContentType "application/json" + $version = "${version}-${branch}${buildNumber}"; } Write-Host "Building version '${version}'" dotnet restore /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true /p:skipFullFramework=$skipFullFramework -$repositoryUrl = "https://github.com/SixLabors/ImageSharp/" +$repositoryUrl = "https://github.com/SixLabors/" if ("$env:GITHUB_REPOSITORY" -ne "") { $repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY" @@ -187,19 +145,7 @@ dotnet build -c Release /p:packageversion=$version /p:skipFullFramework=$skipFul if ($LASTEXITCODE ) { Exit $LASTEXITCODE } -# -# TODO: DO WE NEED TO RUN TESTS IMPLICITLY? -# -# if ( $env:CI -ne "True") { -# cd ./tests/ImageSharp.Tests/ -# dotnet xunit -nobuild -c Release -f netcoreapp2.0 --fx-version 2.0.0 -# ./RunExtendedTests.cmd -# cd ../.. -# } -# - -if ($LASTEXITCODE ) { Exit $LASTEXITCODE } - Write-Host "Packaging projects" -dotnet pack ./src/ImageSharp/ -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl + +dotnet pack -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl if ($LASTEXITCODE ) { Exit $LASTEXITCODE } diff --git a/build/icons/imagesharp-logo-128.png b/build/icons/imagesharp-logo-128.png deleted file mode 100644 index 5c2079144f..0000000000 --- a/build/icons/imagesharp-logo-128.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:148a268c589b628f5d0b5af0e86911a0b393c35b8b25233c71553657c88e0b96 -size 7568 diff --git a/build/icons/imagesharp-logo-256.png b/build/icons/imagesharp-logo-256.png deleted file mode 100644 index e38807ae1e..0000000000 --- a/build/icons/imagesharp-logo-256.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e4b2ff72aef1979500cd130c28490a00be116bb833bc96ca30c85dc0596099c -size 15413 diff --git a/build/icons/imagesharp-logo-32.png b/build/icons/imagesharp-logo-32.png deleted file mode 100644 index 273b171eb2..0000000000 --- a/build/icons/imagesharp-logo-32.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:021c12313afbdc65f58bfea8c7b436d5c2102513bb63d9e64ee2b61a1344c56a -size 1799 diff --git a/build/icons/imagesharp-logo-512.png b/build/icons/imagesharp-logo-512.png deleted file mode 100644 index 707dc9a35b..0000000000 --- a/build/icons/imagesharp-logo-512.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ae54ae0035df1f8f1459081e2f1d5cceda6f88cca6ec015d8c0209bf0d34edf -size 32534 diff --git a/build/icons/imagesharp-logo-64.png b/build/icons/imagesharp-logo-64.png deleted file mode 100644 index 17577772eb..0000000000 --- a/build/icons/imagesharp-logo-64.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:92896854265693f28f9a503b9093cb2c9a4a9b329f310732efdd9c6f6c3761bc -size 3736 diff --git a/build/icons/imagesharp-logo.png b/build/icons/imagesharp-logo.png deleted file mode 100644 index 707dc9a35b..0000000000 --- a/build/icons/imagesharp-logo.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ae54ae0035df1f8f1459081e2f1d5cceda6f88cca6ec015d8c0209bf0d34edf -size 32534 diff --git a/build/icons/imagesharp-logo.svg b/build/icons/imagesharp-logo.svg deleted file mode 100644 index 620287457a..0000000000 --- a/build/icons/imagesharp-logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/run-tests.ps1 b/run-tests.ps1 index 2d563c67e6..c356495440 100644 --- a/run-tests.ps1 +++ b/run-tests.ps1 @@ -1,86 +1,71 @@ param( - [string]$targetFramework, - [string]$is32Bit = "False", - [string]$skipCodeCov = $false + [string]$os, + [string]$targetFramework, + [string]$doCoverage = "False", + [string]$is32Bit = "False" ) -if (!$targetFramework){ - Write-Host "run-tests.ps1 ERROR: targetFramework is undefined!" - exit 1 +if (!$os) { + Write-Host "run-tests.ps1 ERROR: os is undefined!" + exit 1 +} + +if (!$targetFramework) { + Write-Host "run-tests.ps1 ERROR: targetFramework is undefined!" + exit 1 } function VerifyPath($path, $errorMessage) { - if (!(Test-Path -Path $path)) { - Write-Host "run-tests.ps1 $errorMessage `n $xunitRunnerPath" - exit 1 - } + if (!(Test-Path -Path $path)) { + Write-Host "run-tests.ps1 $errorMessage `n $xunitRunnerPath" + exit 1 + } } function CheckSubmoduleStatus() { - $submoduleStatus = (git submodule status) | Out-String - # if the result string is empty, the command failed to run (we didn't capture the error stream) - if ($submoduleStatus) { - # git has been called successfully, what about the status? - if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)")) - { - # submodule has not been initialized! - return 2; - } - elseif ($submoduleStatus -match "\+") - { - # submodule is not synced: - return 1; - } - else { - # everything fine: - return 0; - } - } else { - # git call failed, so we should warn - return 3; + $submoduleStatus = (git submodule status) | Out-String + # if the result string is empty, the command failed to run (we didn't capture the error stream) + if ($submoduleStatus) { + # git has been called successfully, what about the status? + if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)")) { + # submodule has not been initialized! + return 2; } -} - - -if ( ($targetFramework -eq "netcoreapp2.1") -and ($env:CI -eq "True") -and ($is32Bit -ne "True") -and $skipCodeCov -ne $true) { - # We execute CodeCoverage.cmd only for one specific job on CI (netcoreapp2.1 + 64bit ) - $testRunnerCmd = "./tests/CodeCoverage/CodeCoverage.ps1" -} -elseif ($targetFramework -eq "mono") { - $testDllPath = "$PSScriptRoot\tests\ImageSharp.Tests\bin\Release\net462\SixLabors.ImageSharp.Tests.dll" - VerifyPath($testDllPath, "test dll missing:") - - $xunitRunnerPath = "${env:HOMEPATH}\.nuget\packages\xunit.runner.console\2.3.1\tools\net452\" - - VerifyPath($xunitRunnerPath, "xunit console runner is missing on path:") - - cd "$xunitRunnerPath" - - if ($is32Bit -ne "True") { - $monoPath = "${env:PROGRAMFILES}\Mono\bin\mono.exe" + elseif ($submoduleStatus -match "\+") { + # submodule is not synced: + return 1; } else { - $monoPath = "${env:ProgramFiles(x86)}\Mono\bin\mono.exe" + # everything fine: + return 0; } + } + else { + # git call failed, so we should warn + return 3; + } +} - VerifyPath($monoPath, "mono runtime missing:") - - $testRunnerCmd = "& `"${monoPath}`" .\xunit.console.exe `"${testDllPath}`"" +if (($os -eq "windows-latest") -and ($doCoverage -eq "True") -and ($env:CI -eq "True") -and ($is32Bit -ne "True")) { + # We execute CodeCoverage.cmd only for one specific job on CI (windows + coverageTargetFramework + 64bit ) + $testRunnerCmd = ".\tests\CodeCoverage\CodeCoverage.cmd" } else { - cd .\tests\ImageSharp.Tests - $xunitArgs = "-nobuild -c Release -framework $targetFramework" + Set-Location .\tests + $xunitArgs = "-nobuild -c Release -framework $targetFramework" - if ($targetFramework -eq "netcoreapp2.1") { - # There were issues matching the correct installed runtime if we do not specify it explicitly: - $xunitArgs += " --fx-version 2.1.0" - } + $coreTargetFrameworkRegex = '^netcoreapp(\d+\.\d+)$' + if ($targetFramework -match $coreTargetFrameworkRegex) { + # There were issues matching the correct installed runtime if we do not specify it explicitly: + $fxVersion = $matches[1] + ".0" + $xunitArgs += " --fx-version $fxVersion" + } - if ($is32Bit -eq "True") { - $xunitArgs += " -x86" - } + if ($is32Bit -eq "True") { + $xunitArgs += " -x86" + } - $testRunnerCmd = "dotnet xunit $xunitArgs" + $testRunnerCmd = "dotnet xunit $xunitArgs" } Write-Host "running:" @@ -89,25 +74,28 @@ Write-Host "..." Invoke-Expression $testRunnerCmd -cd $PSScriptRoot +Set-Location $PSScriptRoot $exitCodeOfTests = $LASTEXITCODE; if (0 -ne ([int]$exitCodeOfTests)) { - # check submodule status - $submoduleStatus = CheckSubmoduleStatus - if ([int]$submoduleStatus -eq 1) { - # not synced - Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this"; - } elseif ($submoduleStatus -eq 2) { - # not initialized - Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them." - } elseif ($submoduleStatus -eq 3) { - # git not found, maybe submodules not synced? - Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?" - } else { - #Write-Host "Submodules are up to date"; - } + # check submodule status + $submoduleStatus = CheckSubmoduleStatus + if ([int]$submoduleStatus -eq 1) { + # not synced + Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this"; + } + elseif ($submoduleStatus -eq 2) { + # not initialized + Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them." + } + elseif ($submoduleStatus -eq 3) { + # git not found, maybe submodules not synced? + Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?" + } + else { + #Write-Host "Submodules are up to date"; + } } exit $exitCodeOfTests diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 28343eaaa5..8ca1f2ba5e 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -118,10 +118,6 @@ - - - - TextTemplatingFileGenerator diff --git a/tests/CodeCoverage/CodeCoverage.cmd b/tests/CodeCoverage/CodeCoverage.cmd index 01e342b3d2..9b14c163c7 100644 --- a/tests/CodeCoverage/CodeCoverage.cmd +++ b/tests/CodeCoverage/CodeCoverage.cmd @@ -12,10 +12,10 @@ 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.6.519\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*]*" +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" \ No newline at end of file +codecov -f "ImageSharp.Coverage.xml" diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 97bd9b6e7c..9c6fdae3d3 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -13,6 +13,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props tests + false @@ -25,6 +26,11 @@ + + + + + diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index 92c3d79edd..a25b548f2b 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -7,7 +7,6 @@ SixLabors.ImageSharp.Benchmarks netcoreapp2.1 $(TargetFrameworks);net472 - false false @@ -25,8 +24,4 @@ - - - - diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj index d340b2c845..f7959df6af 100644 --- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj +++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj @@ -22,9 +22,5 @@ - - - - - + diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index d71f0958bc..1c909faab6 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -21,10 +21,6 @@ - - - - PreserveNewest @@ -37,9 +33,5 @@ - - - - From ef3197a2ee55ba19e2fb8f89f53c0972e82757dd Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 12:34:20 +1100 Subject: [PATCH 04/53] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 46 ++++++++++++---------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 825c1f1cad..3869517f96 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -69,30 +69,24 @@ jobs: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.xml" flags: unittests - # Publish: - runs-on: windows-latest - needs: [Build] - if: github.event_name == 'push' - steps: - - uses: actions/checkout@v1 - - - name: install nuget - uses: NuGet/setup-nuget@v1 - - - name: Enable long file paths - run: git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init --recursive - - - name: Build - shell: pwsh - run: | - $DebugPreference = "Continue" - ./build.ps1 - - - name: Publish to nightly feed -myget - if: success() - run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package - # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org + # runs-on: windows-latest + # needs: [Build] + # if: github.event_name == 'push' + # steps: + # - uses: actions/checkout@v1 + # - name: install nuget + # uses: NuGet/setup-nuget@v1 + # - name: Enable long file paths + # run: git config --global core.longpaths true + # - name: Update submodules + # run: git submodule -q update --init --recursive + # - name: Build + # shell: pwsh + # run: | + # $DebugPreference = "Continue" + # ./build.ps1 + # - name: Publish to nightly feed -myget + # if: success() + # run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package + # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org From efee2abae62332dba107244df87c7561c4780ab8 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 12:46:52 +1100 Subject: [PATCH 05/53] Remove old xunit reference --- Directory.Build.targets | 2 +- tests/ImageSharp.Tests/ImageSharp.Tests.csproj | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 71dd9ab99a..82712c3f89 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -35,7 +35,7 @@ - + diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 1c909faab6..842582c2f8 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -18,7 +18,6 @@ - From 81f0675716366cc4c5761e0581736135d22564fb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 12:59:14 +1100 Subject: [PATCH 06/53] Debug framework skipping --- build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/build.ps1 b/build.ps1 index e2c62c3d37..94580c0918 100644 --- a/build.ps1 +++ b/build.ps1 @@ -12,6 +12,7 @@ $skipFullFramework = 'false' # If we are trying to build only netcoreapp versions for testings then skip building the full framework targets if ("$targetFramework".StartsWith("netcoreapp")) { + Write-Debug "Skipping Full Framework" $skipFullFramework = 'true' } From d7b94f313232dd0e3e4ed8f5cafdccbb6d024ae4 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 13:09:02 +1100 Subject: [PATCH 07/53] Skip linux for testing --- .github/workflows/build-and-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3869517f96..723128d45e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: opts: - - os: ubuntu-latest - framework: netcoreapp2.1 - runtime: linux-x64 - cover: False + # - os: ubuntu-latest + # framework: netcoreapp2.1 + # runtime: linux-x64 + # cover: False - os: windows-latest framework: netcoreapp2.1 runtime: win-x64 From 105880a937f39b5f7c943cf85af9356c2b75de11 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 13:19:23 +1100 Subject: [PATCH 08/53] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 723128d45e..dc67f6c38f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,7 +14,7 @@ jobs: Build: strategy: matrix: - opts: + options: # - os: ubuntu-latest # framework: netcoreapp2.1 # runtime: linux-x64 @@ -32,7 +32,7 @@ jobs: runtime: win-x86 cover: False - runs-on: ${{ matrix.opts.os }} + runs-on: ${{ matrix.options.os }} steps: - uses: actions/checkout@v1 @@ -52,19 +52,19 @@ jobs: shell: pwsh run: | $DebugPreference = "Continue" - ./build.ps1 "${{matrix.opts.framework}}" + ./build.ps1 "${{matrix.options.framework}}" - name: Test no Coverage - if: matrix.opts.cover != 'True' + if: matrix.options.cover != 'True' run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox - name: Test with Coverage - if: matrix.opts.cover == 'True' + if: matrix.options.cover == 'True' run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: matrix.opts.cover == 'True' + if: matrix.options.cover == 'True' with: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.xml" From 2d95654de78a48c6225ddcdd124448d4fdd9259b Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 13:31:05 +1100 Subject: [PATCH 09/53] Use pwsh for scripts --- .github/workflows/build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index dc67f6c38f..9dd66e11a2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -56,10 +56,12 @@ jobs: - name: Test no Coverage if: matrix.options.cover != 'True' + shell: pwsh run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox - name: Test with Coverage if: matrix.options.cover == 'True' + shell: pwsh run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov From 42a7f0c812ec0227598100fe98c96e0b08d3eeda Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 13:43:23 +1100 Subject: [PATCH 10/53] Fix options naming --- .github/workflows/build-and-test.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9dd66e11a2..438daa402c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,7 +14,7 @@ jobs: Build: strategy: matrix: - options: + opts: # - os: ubuntu-latest # framework: netcoreapp2.1 # runtime: linux-x64 @@ -32,7 +32,7 @@ jobs: runtime: win-x86 cover: False - runs-on: ${{ matrix.options.os }} + runs-on: ${{ matrix.opts.os }} steps: - uses: actions/checkout@v1 @@ -52,21 +52,19 @@ jobs: shell: pwsh run: | $DebugPreference = "Continue" - ./build.ps1 "${{matrix.options.framework}}" + ./build.ps1 "${{matrix.opts.framework}}" - name: Test no Coverage - if: matrix.options.cover != 'True' - shell: pwsh - run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox + if: matrix.opts.cover != True + run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox - name: Test with Coverage - if: matrix.options.cover == 'True' - shell: pwsh - run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + if: matrix.opts.cover == True + run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}} -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: matrix.options.cover == 'True' + if: matrix.opts.cover == True with: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.xml" From 0ec8102315f9cf028f663c27de10ba58b1f9a48c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 13:52:01 +1100 Subject: [PATCH 11/53] Fix booleans? --- .github/workflows/build-and-test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 438daa402c..0ed8760f0b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,19 +18,19 @@ jobs: # - os: ubuntu-latest # framework: netcoreapp2.1 # runtime: linux-x64 - # cover: False + # cover: false - os: windows-latest framework: netcoreapp2.1 runtime: win-x64 - cover: True + cover: true - os: windows-latest framework: net472 runtime: win-x64 - cover: False + cover: false - os: windows-latest framework: net472 runtime: win-x86 - cover: False + cover: false runs-on: ${{ matrix.opts.os }} @@ -55,16 +55,16 @@ jobs: ./build.ps1 "${{matrix.opts.framework}}" - name: Test no Coverage - if: matrix.opts.cover != True + if: matrix.opts.cover == 'false' run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox - name: Test with Coverage - if: matrix.opts.cover == True + if: matrix.opts.cover == 'true' run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}} -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: matrix.opts.cover == True + if: matrix.opts.cover == 'true' with: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.xml" From 224acb4631e5bc49f71865b69a1943e6e91908b5 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 14:06:49 +1100 Subject: [PATCH 12/53] Conditionals are hard. --- .github/workflows/build-and-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0ed8760f0b..9c15ff254b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -55,16 +55,16 @@ jobs: ./build.ps1 "${{matrix.opts.framework}}" - name: Test no Coverage - if: matrix.opts.cover == 'false' + if: ${{matrix.opts.cover}} == 'false' run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox - name: Test with Coverage - if: matrix.opts.cover == 'true' + if: ${{matrix.opts.cover}} == 'true' run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}} -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: matrix.opts.cover == 'true' + if: ${{matrix.opts.cover}} == 'true' with: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.xml" From 4f8649bde2099957e9256ac967299dfff41440db Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 14:10:52 +1100 Subject: [PATCH 13/53] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9c15ff254b..7318eb7884 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -55,16 +55,16 @@ jobs: ./build.ps1 "${{matrix.opts.framework}}" - name: Test no Coverage - if: ${{matrix.opts.cover}} == 'false' + if: matrix.opts.cover == false run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox - name: Test with Coverage - if: ${{matrix.opts.cover}} == 'true' + if: matrix.opts.cover == true run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}} -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: ${{matrix.opts.cover}} == 'true' + if: matrix.opts.cover == true with: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.xml" From 8bce5f26ab97cb5627ce82651ae29402dfa322ec Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 14:16:06 +1100 Subject: [PATCH 14/53] Fix missing quote --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7318eb7884..aa02954fe4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -60,7 +60,7 @@ jobs: - name: Test with Coverage if: matrix.opts.cover == true - run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}} -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 From eccff31979948d6de0c7c7796e08dc7d05fedb4c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 15:46:07 +1100 Subject: [PATCH 15/53] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index aa02954fe4..9b26d790ae 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,19 +17,19 @@ jobs: opts: # - os: ubuntu-latest # framework: netcoreapp2.1 - # runtime: linux-x64 + # runtime: x64 # cover: false - os: windows-latest framework: netcoreapp2.1 - runtime: win-x64 + runtime: x64 # Not currently used. See https://github.com/actions/setup-dotnet/issues/72 cover: true - os: windows-latest framework: net472 - runtime: win-x64 + runtime: x64 cover: false - os: windows-latest framework: net472 - runtime: win-x86 + runtime: x86 cover: false runs-on: ${{ matrix.opts.os }} @@ -56,11 +56,11 @@ jobs: - name: Test no Coverage if: matrix.opts.cover == false - run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox + run: C:\Program Files\dotnet\sdk\ dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox - name: Test with Coverage if: matrix.opts.cover == true - run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" -r "${{matrix.opts.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 From 0006a055b5581142b00a0e853c2d690bafc1aa1c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 15:56:58 +1100 Subject: [PATCH 16/53] Fix tests --- .github/workflows/build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9b26d790ae..06627c1396 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -56,11 +56,11 @@ jobs: - name: Test no Coverage if: matrix.opts.cover == false - run: C:\Program Files\dotnet\sdk\ dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox + run: dotnet test -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox - name: Test with Coverage if: matrix.opts.cover == true - run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + run: dotnet test -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 From f8a86af006a7b0f205007aebe4c2678954a54386 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:08:25 +1100 Subject: [PATCH 17/53] Combine xunit and test for converage --- .github/workflows/build-and-test.yml | 38 ++++--- Directory.Build.targets | 21 ++-- build.cmd | 17 --- build.ps1 | 28 +++-- run-tests.ps1 | 101 ------------------ src/ImageSharp/ImageSharp.csproj | 2 - test.ps1 | 34 ++++++ tests/Directory.Build.props | 3 +- tests/Directory.Build.targets | 16 ++- .../ImageSharp.Benchmarks.csproj | 4 +- .../ImageSharp.Sandbox46.csproj | 6 +- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 13 ++- 12 files changed, 106 insertions(+), 177 deletions(-) delete mode 100644 build.cmd delete mode 100644 run-tests.ps1 create mode 100644 test.ps1 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 06627c1396..ca28dda988 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,25 +14,25 @@ jobs: Build: strategy: matrix: - opts: + options: # - os: ubuntu-latest # framework: netcoreapp2.1 - # runtime: x64 - # cover: false + # runtime: -x64 + # codecov: false - os: windows-latest framework: netcoreapp2.1 - runtime: x64 # Not currently used. See https://github.com/actions/setup-dotnet/issues/72 - cover: true + runtime: -x64 + codecov: true - os: windows-latest framework: net472 - runtime: x64 - cover: false + runtime: -x64 + codecov: false - os: windows-latest framework: net472 - runtime: x86 - cover: false + runtime: -x86 + codecov: false - runs-on: ${{ matrix.opts.os }} + runs-on: ${{ matrix.options.os }} steps: - uses: actions/checkout@v1 @@ -52,22 +52,20 @@ jobs: shell: pwsh run: | $DebugPreference = "Continue" - ./build.ps1 "${{matrix.opts.framework}}" + ./build.ps1 "${{matrix.options.framework}}" - - name: Test no Coverage - if: matrix.opts.cover == false - run: dotnet test -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox - - - name: Test with Coverage - if: matrix.opts.cover == true - run: dotnet test -c Release -f "${{matrix.opts.framework}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + - name: Test + shell: pwsh + run: ./test.ps1 "${{ matrix.options.os }}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" + env: + XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: matrix.opts.cover == true + if: matrix.options.cover == true with: token: ${{secrets.CODECOV_TOKEN}} - file: "coverage.xml" + file: "coverage.${{matrix.options.framework}}.xml" flags: unittests # Publish: # runs-on: windows-latest diff --git a/Directory.Build.targets b/Directory.Build.targets index 82712c3f89..349ee4b3d7 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -15,6 +15,13 @@ $(DefineConstants);$(OS) + + + + + + + @@ -31,19 +38,7 @@ - - - - - - - - - - - - - + diff --git a/build.cmd b/build.cmd deleted file mode 100644 index 6372b41253..0000000000 --- a/build.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@echo Off - -PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1'" - -if not "%errorlevel%"=="0" goto failure - -:success -ECHO successfully built project -REM exit 0 -goto end - -:failure -ECHO failed to build. -REM exit -1 -goto end - -:end \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 94580c0918..07920aca1f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -8,14 +8,6 @@ $version = '' $tagRegex = '^v?(\d+\.\d+\.\d+)(?:-([a-zA-Z]+)\.?(\d*))?$' -$skipFullFramework = 'false' - -# If we are trying to build only netcoreapp versions for testings then skip building the full framework targets -if ("$targetFramework".StartsWith("netcoreapp")) { - Write-Debug "Skipping Full Framework" - $skipFullFramework = 'true' -} - function ToBuildNumber { param( $date ) @@ -99,7 +91,7 @@ else { Write-Debug "Discovered base version from tags '${version}'" } - # Create a build number based on the current time. + # Create a build number based on the current datetime. $buildNumber = "" if ( "$env:GITHUB_SHA" -ne '') { @@ -133,20 +125,26 @@ else { } Write-Host "Building version '${version}'" -dotnet restore /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true /p:skipFullFramework=$skipFullFramework -$repositoryUrl = "https://github.com/SixLabors/" +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 /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl + +dotnet build -c Release $targetFramework /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl if ($LASTEXITCODE ) { Exit $LASTEXITCODE } -Write-Host "Packaging projects" +# 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 } +# dotnet pack -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl +# if ($LASTEXITCODE ) { Exit $LASTEXITCODE } diff --git a/run-tests.ps1 b/run-tests.ps1 deleted file mode 100644 index c356495440..0000000000 --- a/run-tests.ps1 +++ /dev/null @@ -1,101 +0,0 @@ -param( - [string]$os, - [string]$targetFramework, - [string]$doCoverage = "False", - [string]$is32Bit = "False" -) - -if (!$os) { - Write-Host "run-tests.ps1 ERROR: os is undefined!" - exit 1 -} - -if (!$targetFramework) { - Write-Host "run-tests.ps1 ERROR: targetFramework is undefined!" - exit 1 -} - -function VerifyPath($path, $errorMessage) { - if (!(Test-Path -Path $path)) { - Write-Host "run-tests.ps1 $errorMessage `n $xunitRunnerPath" - exit 1 - } -} - -function CheckSubmoduleStatus() { - $submoduleStatus = (git submodule status) | Out-String - # if the result string is empty, the command failed to run (we didn't capture the error stream) - if ($submoduleStatus) { - # git has been called successfully, what about the status? - if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)")) { - # submodule has not been initialized! - return 2; - } - elseif ($submoduleStatus -match "\+") { - # submodule is not synced: - return 1; - } - else { - # everything fine: - return 0; - } - } - else { - # git call failed, so we should warn - return 3; - } -} - -if (($os -eq "windows-latest") -and ($doCoverage -eq "True") -and ($env:CI -eq "True") -and ($is32Bit -ne "True")) { - # We execute CodeCoverage.cmd only for one specific job on CI (windows + coverageTargetFramework + 64bit ) - $testRunnerCmd = ".\tests\CodeCoverage\CodeCoverage.cmd" -} -else { - Set-Location .\tests - $xunitArgs = "-nobuild -c Release -framework $targetFramework" - - $coreTargetFrameworkRegex = '^netcoreapp(\d+\.\d+)$' - if ($targetFramework -match $coreTargetFrameworkRegex) { - # There were issues matching the correct installed runtime if we do not specify it explicitly: - $fxVersion = $matches[1] + ".0" - $xunitArgs += " --fx-version $fxVersion" - } - - if ($is32Bit -eq "True") { - $xunitArgs += " -x86" - } - - $testRunnerCmd = "dotnet xunit $xunitArgs" -} - -Write-Host "running:" -Write-Host $testRunnerCmd -Write-Host "..." - -Invoke-Expression $testRunnerCmd - -Set-Location $PSScriptRoot - -$exitCodeOfTests = $LASTEXITCODE; - -if (0 -ne ([int]$exitCodeOfTests)) { - # check submodule status - $submoduleStatus = CheckSubmoduleStatus - if ([int]$submoduleStatus -eq 1) { - # not synced - Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this"; - } - elseif ($submoduleStatus -eq 2) { - # not initialized - Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them." - } - elseif ($submoduleStatus -eq 3) { - # git not found, maybe submodules not synced? - Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?" - } - else { - #Write-Host "Submodules are up to date"; - } -} - -exit $exitCodeOfTests diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 8ca1f2ba5e..4d354d3cca 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -10,8 +10,6 @@ $(packageversion) 0.0.1 - netcoreapp2.1;netstandard1.3;netstandard2.0 - $(TargetFrameworks);net472 netcoreapp2.1;netstandard2.0;netstandard1.3;net472 true diff --git a/test.ps1 b/test.ps1 new file mode 100644 index 0000000000..ebee0a7f03 --- /dev/null +++ b/test.ps1 @@ -0,0 +1,34 @@ +param( + [Parameter(Mandatory, Position = 0)] + [string]$os, + [Parameter(Mandatory, Position = 1)] + [string]$targetFramework, + [Parameter(Mandatory, Position = 2)] + [string]$platform, + [Parameter(Mandatory, Position = 3)] + [bool]$codecov +) + +if ($codecov -eq $TRUE) { + + # xunit doesn't understand the CollectCoverage params + dotnet clean -c Debug + dotnet test -c Debug -f $targetFramework /p:codecov=true /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput='../../../coverage.xml' +} +else { + + # There were issues matching the correct installed runtime if we do not specify it explicitly: + # https://github.com/xunit/xunit/issues/1476 + # This fix assumes the base version is installed. + $coreTargetFrameworkRegex = '^netcoreapp(\d+\.\d+)$' + if ($targetFramework -match $coreTargetFrameworkRegex) { + $fxVersion = "--fx-version ${matches[1]}.0" + } + + Set-Location $env:XUNIT_PATH + + dotnet clean -c Release + dotnet xunit -c Release -f $targetFramework $fxVersion $platform + + Set-Location $PSScriptRoot +} diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 9c6fdae3d3..48ffbf315a 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -26,7 +26,8 @@ - + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index f8a4936e23..f7b70fe94e 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -15,5 +15,19 @@ - + + + + + + + + + + + + + + + diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index a25b548f2b..bac4ad71c3 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -5,9 +5,9 @@ ImageSharp.Benchmarks Exe SixLabors.ImageSharp.Benchmarks - netcoreapp2.1 - $(TargetFrameworks);net472 + netcoreapp2.1;net472 false + false diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj index f7959df6af..289d2d8508 100644 --- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj +++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj @@ -8,9 +8,9 @@ false SixLabors.ImageSharp.Sandbox46 win7-x64 - netcoreapp2.1 - $(TargetFrameworks);net472 + netcoreapp2.1;net472 SixLabors.ImageSharp.Sandbox46.Program + false @@ -22,5 +22,5 @@ - + diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 842582c2f8..6a78ef21e3 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -2,8 +2,7 @@ - netcoreapp2.1 - $(TargetFrameworks);net462;net472 + netcoreapp2.1;net462;net472 True latest full @@ -12,12 +11,22 @@ SixLabors.ImageSharp.Tests AnyCPU;x64;x86 SixLabors.ImageSharp.Tests + + + true + + + + + + + From 1719378e023ded1c95622344f9a49b251a0f69aa Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:15:47 +1100 Subject: [PATCH 18/53] dotnet restore is implicit in core sdk 2+ --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 07920aca1f..3389c4cc89 100644 --- a/build.ps1 +++ b/build.ps1 @@ -130,7 +130,7 @@ if ($targetFramework -ne 'ALL') { $targetFramework = "-f $targetFramework" } -dotnet restore $targetFramework /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true +# dotnet restore $targetFramework /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true $repositoryUrl = "" From 5e0a711c612ee2347645443fbb6dfbdf0e0b5551 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:25:05 +1100 Subject: [PATCH 19/53] Update build.ps1 --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 3389c4cc89..fd7ac61908 100644 --- a/build.ps1 +++ b/build.ps1 @@ -140,7 +140,7 @@ if ("$env:GITHUB_REPOSITORY" -ne "") { Write-Host "Building projects" -dotnet build -c Release $targetFramework /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl +dotnet build -c Release ${$targetFramework} /p:packageversion=$version /p:RepositoryUrl=$repositoryUrl if ($LASTEXITCODE ) { Exit $LASTEXITCODE } From 2227cc56dbac6d322d2a027a071881a14db005ac Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:34:03 +1100 Subject: [PATCH 20/53] Try passing variable as bool --- .github/workflows/build-and-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ca28dda988..4cee82237b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,19 +18,19 @@ jobs: # - os: ubuntu-latest # framework: netcoreapp2.1 # runtime: -x64 - # codecov: false + # codecov: $false - os: windows-latest framework: netcoreapp2.1 runtime: -x64 - codecov: true + codecov: $true - os: windows-latest framework: net472 runtime: -x64 - codecov: false + codecov: $false - os: windows-latest framework: net472 runtime: -x86 - codecov: false + codecov: $false runs-on: ${{ matrix.options.os }} From 1af76880e14551df14caa291e2fdf6606553263a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:35:46 +1100 Subject: [PATCH 21/53] Update test.ps1 --- test.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.ps1 b/test.ps1 index ebee0a7f03..82c3021d20 100644 --- a/test.ps1 +++ b/test.ps1 @@ -28,7 +28,7 @@ else { Set-Location $env:XUNIT_PATH dotnet clean -c Release - dotnet xunit -c Release -f $targetFramework $fxVersion $platform + dotnet xunit -c Release -f $targetFramework ${fxVersion} $platform Set-Location $PSScriptRoot } From 6eedbf7989801a0b9abf4f68819777bb6dc5cb66 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:41:42 +1100 Subject: [PATCH 22/53] Use strings --- .github/workflows/build-and-test.yml | 8 ++++---- test.ps1 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4cee82237b..ca28dda988 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,19 +18,19 @@ jobs: # - os: ubuntu-latest # framework: netcoreapp2.1 # runtime: -x64 - # codecov: $false + # codecov: false - os: windows-latest framework: netcoreapp2.1 runtime: -x64 - codecov: $true + codecov: true - os: windows-latest framework: net472 runtime: -x64 - codecov: $false + codecov: false - os: windows-latest framework: net472 runtime: -x86 - codecov: $false + codecov: false runs-on: ${{ matrix.options.os }} diff --git a/test.ps1 b/test.ps1 index 82c3021d20..eace163236 100644 --- a/test.ps1 +++ b/test.ps1 @@ -6,10 +6,10 @@ param( [Parameter(Mandatory, Position = 2)] [string]$platform, [Parameter(Mandatory, Position = 3)] - [bool]$codecov + [string]$codecov ) -if ($codecov -eq $TRUE) { +if ($codecov -eq 'true') { # xunit doesn't understand the CollectCoverage params dotnet clean -c Debug From 6efe600a4250c3ffefe49a66c31693cf8c542ecc Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 15 Jan 2020 23:57:09 +1100 Subject: [PATCH 23/53] Update test.ps1 --- test.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test.ps1 b/test.ps1 index eace163236..307d00469a 100644 --- a/test.ps1 +++ b/test.ps1 @@ -11,7 +11,9 @@ param( if ($codecov -eq 'true') { - # xunit doesn't understand the CollectCoverage params + # xunit doesn't understand the CollectCoverage params so use dotnet test + # Coverage tests are run in debug because the coverage tools are triggering a JIT error in filter processors + # that causes the blue component of transformed values to be corrupted. dotnet clean -c Debug dotnet test -c Debug -f $targetFramework /p:codecov=true /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput='../../../coverage.xml' } @@ -25,8 +27,14 @@ else { $fxVersion = "--fx-version ${matches[1]}.0" } + # xunit requires explicit path Set-Location $env:XUNIT_PATH + # xunit doesn't actually understand -x64 as an option + if ($platform -ne '-x86') { + $platform = '' + } + dotnet clean -c Release dotnet xunit -c Release -f $targetFramework ${fxVersion} $platform From d4af87b88ffbfaf6cd1eaef34c15715ae9ae39b6 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 00:12:03 +1100 Subject: [PATCH 24/53] Update PngEncoderTests.cs --- tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index d3e675b907..41576cc0df 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -200,6 +200,12 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png public void PaletteColorType_WuQuantizer(TestImageProvider provider, int paletteSize) where TPixel : struct, IPixel { + // TODO: Investigate WuQuantizer to see if we can reduce memory pressure. + if (!TestEnvironment.Is64BitProcess) + { + return; + } + foreach (PngInterlaceMode interlaceMode in InterlaceMode) { TestPngEncoderCore( From 95dd1e40d459eb1f9a52928ce623a95cb99d1b75 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 00:31:14 +1100 Subject: [PATCH 25/53] Fix codecov condition --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ca28dda988..1383737425 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -62,7 +62,7 @@ jobs: - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 - if: matrix.options.cover == true + if: matrix.options.codecov == true with: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.${{matrix.options.framework}}.xml" From 98b42eb90edb3321bf8cfdc241da7ce8ac07a4d6 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 08:16:58 +1100 Subject: [PATCH 26/53] Use targets. Coverage should now upload --- Directory.Build.props | 9 ------- Directory.Build.targets | 7 ----- ImageSharp.sln | 7 ----- src/Directory.Build.props | 4 +++ test.ps1 | 4 +-- tests/Directory.Build.targets | 27 +++++++++++++++++-- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 12 +++------ 7 files changed, 34 insertions(+), 36 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 95cadcd57f..c8c0fe6f92 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -61,15 +61,6 @@ $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS - - true - - - - - false - - Six Labors and contributors diff --git a/Directory.Build.targets b/Directory.Build.targets index 349ee4b3d7..f6f852b93e 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -14,13 +14,6 @@ $(DefineConstants);$(OS) - - - - - - - diff --git a/ImageSharp.sln b/ImageSharp.sln index 6a80589d8f..eb6c617d09 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -51,12 +51,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{56801022 tests\Directory.Build.targets = tests\Directory.Build.targets EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeCoverage", "CodeCoverage", "{D4C5EC58-F8E6-4636-B9EE-C99D2578E5C6}" - ProjectSection(SolutionItems) = preProject - tests\CodeCoverage\CodeCoverage.cmd = tests\CodeCoverage\CodeCoverage.cmd - tests\CodeCoverage\packages.config = tests\CodeCoverage\packages.config - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{FA55F5DE-11A6-487D-ABA4-BC93A02717DD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Input", "Input", "{9DA226A1-8656-49A8-A58A-A8B5C081AD66}" @@ -405,7 +399,6 @@ Global GlobalSection(NestedProjects) = preSolution {FBE8C1AD-5AEC-4514-9B64-091D8E145865} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D} {2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} - {D4C5EC58-F8E6-4636-B9EE-C99D2578E5C6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {FA55F5DE-11A6-487D-ABA4-BC93A02717DD} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {9DA226A1-8656-49A8-A58A-A8B5C081AD66} = {FA55F5DE-11A6-487D-ABA4-BC93A02717DD} {1A82C5F6-90E0-4E97-BE16-A825C046B493} = {9DA226A1-8656-49A8-A58A-A8B5C081AD66} diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 6fbbb7c916..e94848675f 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,6 +22,10 @@ true + + true + + diff --git a/test.ps1 b/test.ps1 index 307d00469a..61995ca7f6 100644 --- a/test.ps1 +++ b/test.ps1 @@ -11,11 +11,11 @@ param( if ($codecov -eq 'true') { - # xunit doesn't understand the CollectCoverage params so use dotnet test + # xunit doesn't understand custom params so use dotnet test # Coverage tests are run in debug because the coverage tools are triggering a JIT error in filter processors # that causes the blue component of transformed values to be corrupted. dotnet clean -c Debug - dotnet test -c Debug -f $targetFramework /p:codecov=true /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput='../../../coverage.xml' + dotnet test -c Debug -f $targetFramework /p:codecov=true } else { diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index f7b70fe94e..5c8f45e26b 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -15,11 +15,34 @@ - + + + + + + + + + + + + full + true + true + opencover + + $(MSBuildThisFileDirectory)..\coverage.xml + + + true + + + + @@ -29,5 +52,5 @@ - + diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 6a78ef21e3..d09ab9d0b3 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -5,28 +5,22 @@ netcoreapp2.1;net462;net472 True latest - full - portable True SixLabors.ImageSharp.Tests AnyCPU;x64;x86 SixLabors.ImageSharp.Tests - - - true - + + + - - - From c18826312b0c26af2516a9e1b60c75cc7f9920aa Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 09:56:13 +1100 Subject: [PATCH 27/53] Enable ubuntu --- .github/workflows/build-and-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1383737425..d18299aa43 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: options: - # - os: ubuntu-latest - # framework: netcoreapp2.1 - # runtime: -x64 - # codecov: false + - os: ubuntu-latest + framework: netcoreapp2.1 + runtime: -x64 + codecov: false - os: windows-latest framework: netcoreapp2.1 runtime: -x64 From 4568f2b98cb30ba3fc519406d55085ad2c0dd0e2 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 10:21:14 +1100 Subject: [PATCH 28/53] Add targeting pack for linux --- Directory.Build.props | 1 + Directory.Build.targets | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index c8c0fe6f92..f961ae881e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -99,6 +99,7 @@ + diff --git a/Directory.Build.targets b/Directory.Build.targets index f6f852b93e..1d158eccef 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -14,11 +14,12 @@ $(DefineConstants);$(OS) - + + @@ -31,7 +32,7 @@ - + From 19db90581b0fd626d068da54c065f05e192e676b Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 10:49:54 +1100 Subject: [PATCH 29/53] Use dotnet test on linux --- test.ps1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test.ps1 b/test.ps1 index 61995ca7f6..c45074329f 100644 --- a/test.ps1 +++ b/test.ps1 @@ -11,15 +11,19 @@ param( if ($codecov -eq 'true') { - # xunit doesn't understand custom params so use dotnet test + # xunit doesn't understand custom params so use dotnet test. # Coverage tests are run in debug because the coverage tools are triggering a JIT error in filter processors # that causes the blue component of transformed values to be corrupted. dotnet clean -c Debug dotnet test -c Debug -f $targetFramework /p:codecov=true } +elseif ($os -ne 'windows-latest') { + # xunit doesn't run without mono on linux and macos. + dotnet test --no-build -c Release -f $targetFramework +} else { - # There were issues matching the correct installed runtime if we do not specify it explicitly: + # xunit has issues matching the correct installed runtime if we do not specify it explicitly. # https://github.com/xunit/xunit/issues/1476 # This fix assumes the base version is installed. $coreTargetFrameworkRegex = '^netcoreapp(\d+\.\d+)$' @@ -27,16 +31,15 @@ else { $fxVersion = "--fx-version ${matches[1]}.0" } - # xunit requires explicit path + # xunit requires explicit path. Set-Location $env:XUNIT_PATH - # xunit doesn't actually understand -x64 as an option + # xunit doesn't actually understand -x64 as an option. if ($platform -ne '-x86') { $platform = '' } - dotnet clean -c Release - dotnet xunit -c Release -f $targetFramework ${fxVersion} $platform + dotnet xunit --no-build -c Release -f $targetFramework ${fxVersion} $platform Set-Location $PSScriptRoot } From c01f5b6046374710546337436efcf5692dc41fe8 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 13:19:36 +1100 Subject: [PATCH 30/53] GitVersion experiment --- .github/workflows/build-and-test.yml | 88 ++++++++++++++++++++++------ gitversion.yml | 6 ++ 2 files changed, 75 insertions(+), 19 deletions(-) create mode 100644 gitversion.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d18299aa43..ffee25a66c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -19,18 +19,18 @@ jobs: framework: netcoreapp2.1 runtime: -x64 codecov: false - - os: windows-latest - framework: netcoreapp2.1 - runtime: -x64 - codecov: true - - os: windows-latest - framework: net472 - runtime: -x64 - codecov: false - - os: windows-latest - framework: net472 - runtime: -x86 - codecov: false + # - os: windows-latest + # framework: netcoreapp2.1 + # runtime: -x64 + # codecov: true + # - os: windows-latest + # framework: net472 + # runtime: -x64 + # codecov: false + # - os: windows-latest + # framework: net472 + # runtime: -x86 + # codecov: false runs-on: ${{ matrix.options.os }} @@ -40,19 +40,69 @@ jobs: - name: Install nuget uses: NuGet/setup-nuget@v1 - - name: Enable long file paths + - name: Setup Git run: | git config --global core.autocrlf false git config --global core.longpaths true + git fetch --prune --unshallow + git submodule -q update --init --recursive + + - name: Fetch tags for GitVersion + run: | + git fetch --tags - - name: Update Submodules - run: git submodule -q update --init --recursive + - name: Fetch master for GitVersion + if: github.ref != 'refs/heads/master' + run: git branch --create-reflog master origin/master + + - name: Install GitVersion + uses: gittools/actions/setup-gitversion@v0.3 + with: + versionSpec: "5.1.x" + + - name: Use GitVersion + id: gitversion # step id used as reference for output values + uses: gittools/actions/execute-gitversion@v0.3 + - run: | + echo "Major: ${{ steps.gitversion.outputs.major }}" + echo "Minor: ${{ steps.gitversion.outputs.minor }}" + echo "Patch: ${{ steps.gitversion.outputs.patch }}" + echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}" + echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}" + echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}" + echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}" + echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}" + echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}" + echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}" + echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}" + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" + echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" + echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}" + echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}" + echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}" + echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}" + echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}" + echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}" + echo "BranchName: ${{ steps.gitversion.outputs.branchName }}" + echo "Sha: ${{ steps.gitversion.outputs.sha }}" + echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}" + echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" + echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}" + echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}" + echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}" + echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}" + echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}" + echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}" + echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}" - name: Build - shell: pwsh - run: | - $DebugPreference = "Continue" - ./build.ps1 "${{matrix.options.framework}}" + run: dotnet build -c Release -f "${{matrix.options.framework}}" /p:packageversion="${{ steps.gitversion.outputs.nuGetVersion }}" + + # - name: Build + # shell: pwsh + # run: | + # $DebugPreference = "Continue" + # ./build.ps1 "${{matrix.options.framework}}" - name: Test shell: pwsh diff --git a/gitversion.yml b/gitversion.yml new file mode 100644 index 0000000000..42dc350f95 --- /dev/null +++ b/gitversion.yml @@ -0,0 +1,6 @@ +continuous-delivery-fallback-tag: ci +branches: + master: + tag: dev + pull-request: + tag: pr From 2bc8a724d05f85f37dc44e4fc8bcd50a3ca91f22 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 13:21:54 +1100 Subject: [PATCH 31/53] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ffee25a66c..db142c9e9f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,7 +35,7 @@ jobs: runs-on: ${{ matrix.options.os }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Install nuget uses: NuGet/setup-nuget@v1 From 47de179cca46285fdc3988a2c487e90452f7e0e6 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 13:30:30 +1100 Subject: [PATCH 32/53] Delete gitversion.yml --- gitversion.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 gitversion.yml diff --git a/gitversion.yml b/gitversion.yml deleted file mode 100644 index 42dc350f95..0000000000 --- a/gitversion.yml +++ /dev/null @@ -1,6 +0,0 @@ -continuous-delivery-fallback-tag: ci -branches: - master: - tag: dev - pull-request: - tag: pr From 560abf98113aa29bc97515da9f97cc5dd3fc8115 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 13:33:21 +1100 Subject: [PATCH 33/53] Create GitVersion.yml --- GitVersion.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 GitVersion.yml diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000000..42dc350f95 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,6 @@ +continuous-delivery-fallback-tag: ci +branches: + master: + tag: dev + pull-request: + tag: pr From 8ec58b07908cf7d775b1a55e9ff4758d4c20476b Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 16:51:48 +1100 Subject: [PATCH 34/53] Cleanup --- .github/workflows/build-and-test.yml | 80 +++----------- .travis.yml | 43 -------- CodeCoverage.runsettings | 22 ---- ImageSharp.sln | 12 +-- README.md | 13 +-- appveyor.yml | 67 ------------ build.ps1 | 150 --------------------------- ci-build.ps1 | 19 ++++ test.ps1 => ci-test.ps1 | 0 codecov.yml | 4 - tests/CodeCoverage/CodeCoverage.cmd | 21 ---- tests/CodeCoverage/CodeCoverage.ps1 | 11 -- tests/CodeCoverage/packages.config | 4 - 13 files changed, 43 insertions(+), 403 deletions(-) delete mode 100644 .travis.yml delete mode 100644 CodeCoverage.runsettings delete mode 100644 appveyor.yml delete mode 100644 build.ps1 create mode 100644 ci-build.ps1 rename test.ps1 => ci-test.ps1 (100%) delete mode 100644 codecov.yml delete mode 100644 tests/CodeCoverage/CodeCoverage.cmd delete mode 100644 tests/CodeCoverage/CodeCoverage.ps1 delete mode 100644 tests/CodeCoverage/packages.config diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index db142c9e9f..cf97ccdea0 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -32,12 +32,12 @@ jobs: # runtime: -x86 # codecov: false - runs-on: ${{ matrix.options.os }} + runs-on: ${{matrix.options.os}} steps: - uses: actions/checkout@v2 - - name: Install nuget + - name: Install NuGet uses: NuGet/setup-nuget@v1 - name: Setup Git @@ -47,7 +47,7 @@ jobs: git fetch --prune --unshallow git submodule -q update --init --recursive - - name: Fetch tags for GitVersion + - name: Fetch Tags for GitVersion run: | git fetch --tags @@ -63,50 +63,14 @@ jobs: - name: Use GitVersion id: gitversion # step id used as reference for output values uses: gittools/actions/execute-gitversion@v0.3 - - run: | - echo "Major: ${{ steps.gitversion.outputs.major }}" - echo "Minor: ${{ steps.gitversion.outputs.minor }}" - echo "Patch: ${{ steps.gitversion.outputs.patch }}" - echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}" - echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}" - echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}" - echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}" - echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}" - echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}" - echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}" - echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}" - echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" - echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" - echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}" - echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}" - echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}" - echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}" - echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}" - echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}" - echo "BranchName: ${{ steps.gitversion.outputs.branchName }}" - echo "Sha: ${{ steps.gitversion.outputs.sha }}" - echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}" - echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" - echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}" - echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}" - echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}" - echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}" - echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}" - echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}" - echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}" - name: Build - run: dotnet build -c Release -f "${{matrix.options.framework}}" /p:packageversion="${{ steps.gitversion.outputs.nuGetVersion }}" - - # - name: Build - # shell: pwsh - # run: | - # $DebugPreference = "Continue" - # ./build.ps1 "${{matrix.options.framework}}" + shell: pwsh + run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}" - name: Test shell: pwsh - run: ./test.ps1 "${{ matrix.options.os }}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" + run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" env: XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit @@ -117,24 +81,14 @@ jobs: token: ${{secrets.CODECOV_TOKEN}} file: "coverage.${{matrix.options.framework}}.xml" flags: unittests - # Publish: - # runs-on: windows-latest - # needs: [Build] - # if: github.event_name == 'push' - # steps: - # - uses: actions/checkout@v1 - # - name: install nuget - # uses: NuGet/setup-nuget@v1 - # - name: Enable long file paths - # run: git config --global core.longpaths true - # - name: Update submodules - # run: git submodule -q update --init --recursive - # - name: Build - # shell: pwsh - # run: | - # $DebugPreference = "Continue" - # ./build.ps1 - # - name: Publish to nightly feed -myget - # if: success() - # run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package - # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org + + - name: Pack + if: matrix.options.codecov == true # We can use this filter as we know it happens only once and takes the most ime to complete. + shell: pwsh + run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" + + - name: Publish to MyGet + if: (github.event_name == 'push') && (matrix.options.codecov == true) + shell: pwsh + run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package + # TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6fd38484dd..0000000000 --- a/.travis.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/CodeCoverage.runsettings b/CodeCoverage.runsettings deleted file mode 100644 index d9c0848f13..0000000000 --- a/CodeCoverage.runsettings +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - .*ImageSharp.dll - - - .*tests* - .*Tests* - - - - - - - - \ No newline at end of file diff --git a/ImageSharp.sln b/ImageSharp.sln index eb6c617d09..9c627791e9 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -3,24 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28902.138 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig .gitattributes = .gitattributes .gitignore = .gitignore .gitmodules = .gitmodules - .travis.yml = .travis.yml - appveyor.yml = appveyor.yml - build.cmd = build.cmd - build.ps1 = build.ps1 - codecov.yml = codecov.yml - CodeCoverage.runsettings = CodeCoverage.runsettings + ci-build.ps1 = ci-build.ps1 + ci-test.ps1 = ci-test.ps1 Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets + GitVersion.yml = GitVersion.yml ImageSharp.sln.DotSettings = ImageSharp.sln.DotSettings LICENSE = LICENSE README.md = README.md - run-tests.ps1 = run-tests.ps1 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1799C43E-5C54-4A8F-8D64-B1475241DB0D}" diff --git a/README.md b/README.md index ba897fa7ef..c0bc345737 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Install stable releases via Nuget; development releases are available via MyGet. | Package Name | Release (NuGet) | Nightly (MyGet) | |--------------------------------|-----------------|-----------------| | `SixLabors.ImageSharp` | [![NuGet](https://img.shields.io/nuget/v/SixLabors.ImageSharp.svg)](https://www.nuget.org/packages/SixLabors.ImageSharp/) | [![MyGet](https://img.shields.io/myget/sixlabors/v/SixLabors.ImageSharp.svg)](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp) | -| `SixLabors.ImageSharp.Drawing` | [![NuGet](https://img.shields.io/nuget/v/SixLabors.ImageSharp.Drawing.svg)](https://www.nuget.org/packages/SixLabors.ImageSharp.Drawing/) | [![MyGet](https://img.shields.io/myget/sixlabors/v/SixLabors.ImageSharp.Drawing.svg)](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp.Drawing) | ### Packages @@ -46,17 +45,11 @@ The **ImageSharp** library is made up of multiple packages: - Transform methods like Resize, Crop, Skew, Rotate - anything that alters the dimensions of the image - Non-transform methods like Gaussian Blur, Pixelate, Edge Detection - anything that maintains the original image dimensions -- **SixLabors.ImageSharp.Drawing** - - Brushes and various drawing algorithms, including drawing images - - Various vector drawing methods for drawing paths, polygons etc. - - Text drawing - ### Build Status -| |Build Status|Code Coverage| -|-------------|:----------:|:-----------:| -|**Linux/Mac**|[![Build Status](https://travis-ci.org/SixLabors/ImageSharp.svg)](https://travis-ci.org/SixLabors/ImageSharp)|[![Code coverage](https://codecov.io/gh/SixLabors/ImageSharp/branch/master/graph/badge.svg)](https://codecov.io/gh/SixLabors/ImageSharp)| -|**Windows** |[![Build Status](https://ci.appveyor.com/api/projects/status/m9pn907xdah3ca39/branch/master?svg=true)](https://ci.appveyor.com/project/six-labors/imagesharp/branch/master)|[![Code coverage](https://codecov.io/gh/SixLabors/ImageSharp/branch/master/graph/badge.svg)](https://codecov.io/gh/SixLabors/ImageSharp)| +|Build Status|Code Coverage| +|:----------:|:-----------:| +|[![Build Status](https://img.shields.io/github/workflow/status/SixLabors/ImageSharp/Build/master)](https://github.com/SixLabors/ImageSharp/actions)|[![Code coverage](https://codecov.io/gh/SixLabors/ImageSharp/branch/master/graph/badge.svg)](https://codecov.io/gh/SixLabors/ImageSharp)| ### Questions? diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 87137da2f3..0000000000 --- a/appveyor.yml +++ /dev/null @@ -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 diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index fd7ac61908..0000000000 --- a/build.ps1 +++ /dev/null @@ -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 } diff --git a/ci-build.ps1 b/ci-build.ps1 new file mode 100644 index 0000000000..934b471d1e --- /dev/null +++ b/ci-build.ps1 @@ -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 +} diff --git a/test.ps1 b/ci-test.ps1 similarity index 100% rename from test.ps1 rename to ci-test.ps1 diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index ae6dd5f6bf..0000000000 --- a/codecov.yml +++ /dev/null @@ -1,4 +0,0 @@ -ignore: - "src/ImageSharp/Common/Helpers/DebugGuard.cs" - - \ No newline at end of file diff --git a/tests/CodeCoverage/CodeCoverage.cmd b/tests/CodeCoverage/CodeCoverage.cmd deleted file mode 100644 index 9b14c163c7..0000000000 --- a/tests/CodeCoverage/CodeCoverage.cmd +++ /dev/null @@ -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" diff --git a/tests/CodeCoverage/CodeCoverage.ps1 b/tests/CodeCoverage/CodeCoverage.ps1 deleted file mode 100644 index b7073998f9..0000000000 --- a/tests/CodeCoverage/CodeCoverage.ps1 +++ /dev/null @@ -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 } \ No newline at end of file diff --git a/tests/CodeCoverage/packages.config b/tests/CodeCoverage/packages.config deleted file mode 100644 index 973b7f81b4..0000000000 --- a/tests/CodeCoverage/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From c46da8f40edd9367ecdce29aec1faeab92477006 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 16:59:18 +1100 Subject: [PATCH 35/53] Update ci-build.ps1 --- ci-build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-build.ps1 b/ci-build.ps1 index 934b471d1e..ad757dc9e2 100644 --- a/ci-build.ps1 +++ b/ci-build.ps1 @@ -1,6 +1,7 @@ param( [Parameter(Mandatory, Position = 0)] [string]$version, + [Parameter(Mandatory = $false, Position = 1)] [string]$targetFramework = 'ALL' ) From 68ecb31b7f7155e903931aa8cc738d16b58193e2 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 20:43:07 +1100 Subject: [PATCH 36/53] Cleanup solution --- .gitattributes | 6 + .github/workflows/build-and-test.yml | 4 +- Directory.Build.props | 10 +- Directory.Build.targets | 4 +- ImageSharp.sln | 1 - ImageSharp.sln.DotSettings | 393 ------------------ shared-infrastructure | 2 +- src/Directory.Build.props | 10 +- src/ImageSharp/ImageSharp.csproj | 1 - tests/Directory.Build.props | 8 +- tests/Directory.Build.targets | 1 - .../ImageSharp.Benchmarks.csproj | 2 +- .../ImageSharp.Sandbox46.csproj | 1 + .../ImageSharp.Tests/ImageSharp.Tests.csproj | 3 - .../ImageSharp.Tests.v3.ncrunchproject | 9 - tests/ImageSharp.Tests/RunExtendedTests.cmd | 9 - 16 files changed, 26 insertions(+), 438 deletions(-) delete mode 100644 ImageSharp.sln.DotSettings delete mode 100644 tests/ImageSharp.Tests/ImageSharp.Tests.v3.ncrunchproject delete mode 100644 tests/ImageSharp.Tests/RunExtendedTests.cmd diff --git a/.gitattributes b/.gitattributes index 163f9ddfe0..2cbe4b423a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -62,18 +62,24 @@ # normalize to Windows-style line endings and *.sln text eol=crlf merge=union # treat as binary +*.basis binary *.bmp binary +*.dds binary *.dll binary *.eot binary *.exe binary *.gif binary *.jpg binary +*.ktx binary +*.pbm binary *.pdf binary *.png binary *.ppt binary *.pptx binary +*.pvr binary *.ttf binary *.snk binary +*.tga binary *.woff binary *.woff2 binary *.xls binary diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index cf97ccdea0..0cc3f96443 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -82,8 +82,8 @@ jobs: file: "coverage.${{matrix.options.framework}}.xml" flags: unittests - - name: Pack - if: matrix.options.codecov == true # We can use this filter as we know it happens only once and takes the most ime to complete. + - name: Pack # We can use this filter as we know it happens only once and takes the most time to complete. + if: (github.event_name == 'push') && (matrix.options.codecov == true) shell: pwsh run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" diff --git a/Directory.Build.props b/Directory.Build.props index f961ae881e..dcdc62a52a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -79,10 +79,10 @@ Copyright © Six Labors and Contributors strict;IOperation true - 7.3 + 8.0 en true - https://raw.githubusercontent.com/SixLabors/Branding/master/icons/imagesharp/sixlabors.imagesharp.128.png + icon.png Apache-2.0 $(RepositoryUrl) true @@ -96,10 +96,14 @@ true - + + + + + diff --git a/Directory.Build.targets b/Directory.Build.targets index 1d158eccef..f69a873acc 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -20,13 +20,13 @@ - + + - diff --git a/ImageSharp.sln b/ImageSharp.sln index 9c627791e9..2adc18f46d 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -14,7 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets GitVersion.yml = GitVersion.yml - ImageSharp.sln.DotSettings = ImageSharp.sln.DotSettings LICENSE = LICENSE README.md = README.md EndProjectSection diff --git a/ImageSharp.sln.DotSettings b/ImageSharp.sln.DotSettings deleted file mode 100644 index ece3dddb3c..0000000000 --- a/ImageSharp.sln.DotSettings +++ /dev/null @@ -1,393 +0,0 @@ - - <?xml version="1.0" encoding="utf-16"?> -<Profile name="StyleCop"> - <CSUpdateFileHeader>False</CSUpdateFileHeader> - <CSArrangeQualifiers>True</CSArrangeQualifiers> - <CSOptimizeUsings> - <OptimizeUsings>True</OptimizeUsings> - <EmbraceInRegion>False</EmbraceInRegion> - <RegionName></RegionName> - </CSOptimizeUsings> - <CSReformatCode>True</CSReformatCode> - <CSReorderTypeMembers>True</CSReorderTypeMembers> -</Profile> - StyleCop - public protected internal private static new abstract virtual override sealed readonly extern unsafe volatile async - Field, Property, Event, Method - True - True - True - True - True - True - True - True - True - NEXT_LINE_SHIFTED_2 - 1 - 1 - 1 - 1 - 1 - NEXT_LINE_SHIFTED_2 - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - NEXT_LINE_SHIFTED_2 - 1 - 1 - False - False - False - NEVER - False - False - NEVER - False - ALWAYS - False - True - ON_SINGLE_LINE - False - True - True - False - True - True - CHOP_IF_LONG - True - True - CHOP_IF_LONG - CHOP_IF_LONG - <?xml version="1.0" encoding="utf-16"?> -<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> - <TypePattern DisplayName="COM interfaces or structs"> - <TypePattern.Match> - <Or> - <And> - <Kind Is="Interface" /> - <Or> - <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> - <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> - </Or> - </And> - <Kind Is="Struct" /> - </Or> - </TypePattern.Match> - </TypePattern> - <TypePattern DisplayName="P/Invoke classes called 'NativeMethods' (StyleCop)"> - <TypePattern.Match> - <And> - <Kind Is="Class" /> - <Name Is=".*NativeMethods" /> - </And> - </TypePattern.Match> - </TypePattern> - <TypePattern DisplayName="DataMember serialisation classes (StyleCop)"> - <TypePattern.Match> - <And> - <Or> - <Kind Is="Field" /> - <Kind Is="Property" /> - </Or> - <HasAttribute Name="System.Runtime.Serialization.DataMemberAttribute" /> - </And> - </TypePattern.Match> - </TypePattern> - <TypePattern DisplayName="Default Pattern (StyleCop)" RemoveRegions="All"> - <Entry DisplayName="Constants"> - <Entry.Match> - <Kind Is="Constant" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Static fields"> - <Entry.Match> - <And> - <Kind Is="Field" /> - <Static /> - </And> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Readonly /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Fields"> - <Entry.Match> - <Kind Is="Field" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Readonly /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="200" DisplayName="Constructors and Destructors"> - <Entry.Match> - <Or> - <Kind Is="Constructor" /> - <Kind Is="Destructor" /> - </Or> - </Entry.Match> - <Entry.SortBy> - <Static /> - <Kind Order="Constructor Destructor" /> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Delegates"> - <Entry.Match> - <Kind Is="Delegate" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Public events"> - <Entry.Match> - <And> - <Kind Is="Event" /> - <Access Is="Public" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Interface events"> - <Entry.Match> - <And> - <Kind Is="Event" /> - <ImplementsInterface /> - </And> - </Entry.Match> - <Entry.SortBy> - <ImplementsInterface Immediate="True" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Other events"> - <Entry.Match> - <Kind Is="Event" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Enums"> - <Entry.Match> - <Kind Is="Enum" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Interfaces"> - <Entry.Match> - <Kind Is="Interface" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Public properties"> - <Entry.Match> - <And> - <Kind Is="Property" /> - <Access Is="Public" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Interface properties"> - <Entry.Match> - <And> - <Kind Is="Property" /> - <ImplementsInterface /> - </And> - </Entry.Match> - <Entry.SortBy> - <ImplementsInterface Immediate="True" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Other properties"> - <Entry.Match> - <Kind Is="Property" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="1000" DisplayName="Public indexers"> - <Entry.Match> - <And> - <Kind Is="Indexer" /> - <Access Is="Public" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="1000" DisplayName="Interface indexers"> - <Entry.Match> - <And> - <Kind Is="Indexer" /> - <ImplementsInterface /> - </And> - </Entry.Match> - <Entry.SortBy> - <ImplementsInterface Immediate="True" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="1000" DisplayName="Other indexers"> - <Entry.Match> - <Kind Is="Indexer" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Public methods and operators"> - <Entry.Match> - <And> - <Or> - <Kind Is="Method" /> - <Kind Is="Operator" /> - </Or> - <Access Is="Public" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Interface methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <ImplementsInterface /> - </And> - </Entry.Match> - <Entry.SortBy> - <ImplementsInterface Immediate="True" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Other methods"> - <Entry.Match> - <Kind Is="Method" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Operators"> - <Entry.Match> - <Kind Is="Operator" /> - </Entry.Match> - <Entry.SortBy> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Static /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="600" DisplayName="Nested structs"> - <Entry.Match> - <Kind Is="Struct" /> - </Entry.Match> - <Entry.SortBy> - <Static /> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="700" DisplayName="Nested classes"> - <Entry.Match> - <Kind Is="Class" /> - </Entry.Match> - <Entry.SortBy> - <Static /> - <Access Order="Public Internal ProtectedInternal Protected Private" /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="All other members" /> - </TypePattern> -</Patterns> - False - True - // Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - - AC - DC - DCT - EOF - FDCT - IDCT - JPEG - MCU - PNG - RGB - RLE - XY - XYZ - $object$_On$event$ - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - True - True - True - True - True - True - True - True - True - True - True - True - \ No newline at end of file diff --git a/shared-infrastructure b/shared-infrastructure index c2e689abe9..40f740dea2 160000 --- a/shared-infrastructure +++ b/shared-infrastructure @@ -1 +1 @@ -Subproject commit c2e689abe9227209e6d5bc4bf56255d92b4a5d62 +Subproject commit 40f740dea2aad9dabae12a8e1e17fdcf476066ba diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e94848675f..0bddf7e696 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -25,11 +25,7 @@ true - - - - - + @@ -38,8 +34,4 @@ - - - - diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 4d354d3cca..5e64adf537 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -192,7 +192,6 @@ - diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 48ffbf315a..22c634d9b2 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -17,7 +17,9 @@ - CS0618;$(NoWarn) + $(MSBuildThisFileDirectory)..\shared-infrastructure\SixLabors.Tests.ruleset + + $(NoWarn);CS0618 @@ -26,8 +28,8 @@ - + + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 5c8f45e26b..40347763d9 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -26,7 +26,6 @@ - full true true opencover diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index bac4ad71c3..70c5481dac 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -7,7 +7,7 @@ SixLabors.ImageSharp.Benchmarks netcoreapp2.1;net472 false - false + diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj index 289d2d8508..7afe33fb5c 100644 --- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj +++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj @@ -10,6 +10,7 @@ win7-x64 netcoreapp2.1;net472 SixLabors.ImageSharp.Sandbox46.Program + false diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index d09ab9d0b3..743c2eee02 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -4,7 +4,6 @@ netcoreapp2.1;net462;net472 True - latest True SixLabors.ImageSharp.Tests AnyCPU;x64;x86 @@ -16,8 +15,6 @@ - - diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.v3.ncrunchproject b/tests/ImageSharp.Tests/ImageSharp.Tests.v3.ncrunchproject deleted file mode 100644 index f015b4b86e..0000000000 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.v3.ncrunchproject +++ /dev/null @@ -1,9 +0,0 @@ - - - False - UseStaticAnalysis - - False - False - - \ No newline at end of file diff --git a/tests/ImageSharp.Tests/RunExtendedTests.cmd b/tests/ImageSharp.Tests/RunExtendedTests.cmd deleted file mode 100644 index c2f4b9f537..0000000000 --- a/tests/ImageSharp.Tests/RunExtendedTests.cmd +++ /dev/null @@ -1,9 +0,0 @@ -dotnet build -c Release -dotnet xunit -nobuild -c Release -f net462 -dotnet xunit -nobuild -c Release -f net462 -x86 -dotnet xunit -nobuild -c Release -f net47 -dotnet xunit -nobuild -c Release -f net47 -x86 -dotnet xunit -nobuild -c Release -f net471 -dotnet xunit -nobuild -c Release -f net471 -x86 -dotnet xunit -nobuild -c Release -f net472 -dotnet xunit -nobuild -c Release -f net472 -x86 From 03aa2fb77588fb0db96f6981992f202fc2e0629d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 21:29:22 +1100 Subject: [PATCH 37/53] Add new target frameworks --- .github/workflows/build-and-test.yml | 8 ++++-- Directory.Build.props | 27 +++++++++---------- src/ImageSharp/Common/Helpers/TestHelpers.cs | 14 ++++++---- src/ImageSharp/ImageSharp.csproj | 2 +- tests/ImageSharp.Benchmarks/Config.cs | 1 + .../ImageSharp.Benchmarks.csproj | 2 +- .../ImageSharp.Sandbox46.csproj | 2 +- .../Image/ImageTests.WrapMemory.cs | 2 +- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 2 +- .../Tests/TestEnvironmentTests.cs | 23 ---------------- 10 files changed, 34 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0cc3f96443..2fc6f0b381 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,14 +16,18 @@ jobs: matrix: options: - os: ubuntu-latest - framework: netcoreapp2.1 + framework: netcoreapp3.1 runtime: -x64 codecov: false # - os: windows-latest - # framework: netcoreapp2.1 + # framework: netcoreapp3.1 # runtime: -x64 # codecov: true # - os: windows-latest + # framework: netcoreapp2.1 + # runtime: -x64 + # codecov: false + # - os: windows-latest # framework: net472 # runtime: -x64 # codecov: false diff --git a/Directory.Build.props b/Directory.Build.props index dcdc62a52a..02f7b77211 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -31,22 +31,21 @@ - - $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING + $(DefineConstants);MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS; $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING @@ -55,7 +54,7 @@ $(DefineConstants);SUPPORTS_MATHF; - $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING + $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS diff --git a/src/ImageSharp/Common/Helpers/TestHelpers.cs b/src/ImageSharp/Common/Helpers/TestHelpers.cs index d330233c4c..c6574e4b58 100644 --- a/src/ImageSharp/Common/Helpers/TestHelpers.cs +++ b/src/ImageSharp/Common/Helpers/TestHelpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. namespace SixLabors.ImageSharp.Common.Helpers @@ -13,14 +13,18 @@ namespace SixLabors.ImageSharp.Common.Helpers /// Only intended to be used in tests! /// internal const string ImageSharpBuiltAgainst = -#if NET472 - "netfx4.7.2"; +#if NETCOREAPP3_1 + "netcoreapp3.1"; #elif NETCOREAPP2_1 "netcoreapp2.1"; +#elif NETSTANDARD2_1 + "netstandard2.1"; +#elif NETSTANDARD2_0 + "netstandard2.0"; #elif NETSTANDARD1_3 "netstandard1.3"; #else - "netstandard2.0"; + "net472"; #endif } -} \ No newline at end of file +} diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 5e64adf537..f13989acdc 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -10,7 +10,7 @@ $(packageversion) 0.0.1 - netcoreapp2.1;netstandard2.0;netstandard1.3;net472 + netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472 true true diff --git a/tests/ImageSharp.Benchmarks/Config.cs b/tests/ImageSharp.Benchmarks/Config.cs index 018a2e02bf..cb4fcbba18 100644 --- a/tests/ImageSharp.Benchmarks/Config.cs +++ b/tests/ImageSharp.Benchmarks/Config.cs @@ -21,6 +21,7 @@ namespace SixLabors.ImageSharp.Benchmarks { this.Add( Job.Default.With(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), + Job.Default.With(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), Job.Default.With(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3) ); } diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index 70c5481dac..34f517500c 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -5,7 +5,7 @@ ImageSharp.Benchmarks Exe SixLabors.ImageSharp.Benchmarks - netcoreapp2.1;net472 + netcoreapp3.1;netcoreapp2.1;net472 false diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj index 7afe33fb5c..e89b28dc11 100644 --- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj +++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj @@ -8,7 +8,7 @@ false SixLabors.ImageSharp.Sandbox46 win7-x64 - netcoreapp2.1;net472 + netcoreapp3.1;netcoreapp2.1;net472 SixLabors.ImageSharp.Sandbox46.Program false diff --git a/tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs b/tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs index 63c2e57c8c..04d05f6dc7 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs @@ -172,7 +172,7 @@ namespace SixLabors.ImageSharp.Tests } private static bool ShouldSkipBitmapTest => - !TestEnvironment.Is64BitProcess || TestHelpers.ImageSharpBuiltAgainst != "netcoreapp2.1"; + !TestEnvironment.Is64BitProcess || (TestHelpers.ImageSharpBuiltAgainst != "netcoreapp3.1" && TestHelpers.ImageSharpBuiltAgainst != "netcoreapp2.1"); } } } diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 743c2eee02..41e6749be6 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -2,7 +2,7 @@ - netcoreapp2.1;net462;net472 + netcoreapp3.1;netcoreapp2.1;net472 True True SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs index 567a1b0302..07523f6178 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs @@ -33,29 +33,6 @@ namespace SixLabors.ImageSharp.Tests Assert.True(Directory.Exists(path)); } - ///// - ///// We need this test to make sure that the netcoreapp2.1 test execution actually covers the netcoreapp2.1 build configuration of ImageSharp. - ///// - //[Fact] - //public void ImageSharpAssemblyUnderTest_MatchesExpectedTargetFramework() - //{ - // this.Output.WriteLine("NetCoreVersion: " + TestEnvironment.NetCoreVersion); - // this.Output.WriteLine("ImageSharpBuiltAgainst: " + TestHelpers.ImageSharpBuiltAgainst); - - // if (string.IsNullOrEmpty(TestEnvironment.NetCoreVersion)) - // { - // this.Output.WriteLine("Not running under .NET Core!"); - // } - // else if (TestEnvironment.NetCoreVersion.StartsWith("2.1")) - // { - // Assert.Equal("netcoreapp2.1", TestHelpers.ImageSharpBuiltAgainst); - // } - // else - // { - // Assert.Equal("netstandard2.0", TestHelpers.ImageSharpBuiltAgainst); - // } - //} - [Fact] public void SolutionDirectoryFullPath() { From 19b52d7839c647df2d41ac0c8f3c2366d5136fe9 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 21:37:09 +1100 Subject: [PATCH 38/53] Add netcore 3.1 SDK action --- .github/workflows/build-and-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2fc6f0b381..74b3ea756b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -68,6 +68,11 @@ jobs: id: gitversion # step id used as reference for output values uses: gittools/actions/execute-gitversion@v0.3 + - name: Install DotNet SDK + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: "3.1.101" # SDK Version to use. + - name: Build shell: pwsh run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}" From 37a2c160c8a744ed5ba78140e901ca3a6475a37d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 21:41:00 +1100 Subject: [PATCH 39/53] Revert "Add netcore 3.1 SDK action" This reverts commit c957caa47b66407944169eced6d42c55d8e02810. --- .github/workflows/build-and-test.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 74b3ea756b..2fc6f0b381 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -68,11 +68,6 @@ jobs: id: gitversion # step id used as reference for output values uses: gittools/actions/execute-gitversion@v0.3 - - name: Install DotNet SDK - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "3.1.101" # SDK Version to use. - - name: Build shell: pwsh run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}" From 3e61667aea66db5d599983f174960bc40a0ee08c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 21:44:39 +1100 Subject: [PATCH 40/53] Add 3.1.101 SDK --- .github/workflows/build-and-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2fc6f0b381..aac90f403e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -68,6 +68,11 @@ jobs: id: gitversion # step id used as reference for output values uses: gittools/actions/execute-gitversion@v0.3 + - name: Setup DotNet SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "3.1.101" + - name: Build shell: pwsh run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}" From 3bcc221f9769b23d79fae26acaa883a283b98acc Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 21:49:10 +1100 Subject: [PATCH 41/53] Update Directory.Build.props --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 02f7b77211..e4e52ac164 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -45,7 +45,7 @@ --> - $(DefineConstants);MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS; + $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS; $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING From c21d3f7589f8a06b2f0c39add3e69bb33d569d36 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 21:54:50 +1100 Subject: [PATCH 42/53] Test xunit pipeline --- .github/workflows/build-and-test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index aac90f403e..3a3cd65d16 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: options: - - os: ubuntu-latest - framework: netcoreapp3.1 - runtime: -x64 - codecov: false + # - os: ubuntu-latest + # framework: netcoreapp3.1 + # runtime: -x64 + # codecov: false # - os: windows-latest # framework: netcoreapp3.1 # runtime: -x64 @@ -27,10 +27,10 @@ jobs: # framework: netcoreapp2.1 # runtime: -x64 # codecov: false - # - os: windows-latest - # framework: net472 - # runtime: -x64 - # codecov: false + - os: windows-latest + framework: net472 + runtime: -x64 + codecov: false # - os: windows-latest # framework: net472 # runtime: -x86 From 5ee2e07df2a6aaacd99c8a73050703e841c9ee42 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 22:02:27 +1100 Subject: [PATCH 43/53] Move nuget fix --- .github/workflows/build-and-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3a3cd65d16..dc23f2560d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -41,9 +41,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install NuGet - uses: NuGet/setup-nuget@v1 - - name: Setup Git run: | git config --global core.autocrlf false @@ -68,6 +65,9 @@ jobs: id: gitversion # step id used as reference for output values uses: gittools/actions/execute-gitversion@v0.3 + - name: Install NuGet + uses: NuGet/setup-nuget@v1 + - name: Setup DotNet SDK uses: actions/setup-dotnet@v1 with: From f5f48dbbcd44005d84e3ee0695db094e25d003eb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 22:06:20 +1100 Subject: [PATCH 44/53] Enable linux --- .github/workflows/build-and-test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index dc23f2560d..75e0d664d7 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: options: - # - os: ubuntu-latest - # framework: netcoreapp3.1 - # runtime: -x64 - # codecov: false + - os: ubuntu-latest + framework: netcoreapp3.1 + runtime: -x64 + codecov: false # - os: windows-latest # framework: netcoreapp3.1 # runtime: -x64 @@ -41,6 +41,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install NuGet + uses: NuGet/setup-nuget@v1 + - name: Setup Git run: | git config --global core.autocrlf false @@ -65,9 +68,6 @@ jobs: id: gitversion # step id used as reference for output values uses: gittools/actions/execute-gitversion@v0.3 - - name: Install NuGet - uses: NuGet/setup-nuget@v1 - - name: Setup DotNet SDK uses: actions/setup-dotnet@v1 with: From bd55155131b111798f5efe246c5de1ac5932f598 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 22:31:43 +1100 Subject: [PATCH 45/53] Try using bash --- .github/workflows/build-and-test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 75e0d664d7..1ca95c1e7a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: options: - - os: ubuntu-latest - framework: netcoreapp3.1 - runtime: -x64 - codecov: false + # - os: ubuntu-latest + # framework: netcoreapp3.1 + # runtime: -x64 + # codecov: false # - os: windows-latest # framework: netcoreapp3.1 # runtime: -x64 @@ -45,6 +45,7 @@ jobs: uses: NuGet/setup-nuget@v1 - name: Setup Git + shell: bash run: | git config --global core.autocrlf false git config --global core.longpaths true From f001c68bef43f64c36082792d7d34f6560cb5fbd Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 22:43:21 +1100 Subject: [PATCH 46/53] Test all frameworks --- .github/workflows/build-and-test.yml | 32 ++++++++++++++-------------- README.md | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1ca95c1e7a..e7f4a143b4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,26 +15,26 @@ jobs: strategy: matrix: options: - # - os: ubuntu-latest - # framework: netcoreapp3.1 - # runtime: -x64 - # codecov: false - # - os: windows-latest - # framework: netcoreapp3.1 - # runtime: -x64 - # codecov: true - # - os: windows-latest - # framework: netcoreapp2.1 - # runtime: -x64 - # codecov: false + - os: ubuntu-latest + framework: netcoreapp3.1 + runtime: -x64 + codecov: false + - os: windows-latest + framework: netcoreapp3.1 + runtime: -x64 + codecov: true + - os: windows-latest + framework: netcoreapp2.1 + runtime: -x64 + codecov: false - os: windows-latest framework: net472 runtime: -x64 codecov: false - # - os: windows-latest - # framework: net472 - # runtime: -x86 - # codecov: false + - os: windows-latest + framework: net472 + runtime: -x86 + codecov: false runs-on: ${{matrix.options.os}} diff --git a/README.md b/README.md index c0bc345737..ceb1e51d22 100644 --- a/README.md +++ b/README.md @@ -106,9 +106,9 @@ For more examples check out: If you prefer, you can compile ImageSharp yourself (please do and help!) -- Using [Visual Studio 2017](https://visualstudio.microsoft.com/vs/) +- Using [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) - Make sure you have the latest version installed - - Make sure you have [the .NET Core 2.1 SDK](https://www.microsoft.com/net/core#windows) installed + - Make sure you have [the .NET Core 3.1 SDK](https://www.microsoft.com/net/core#windows) installed Alternatively, you can work from command line and/or with a lightweight editor on **both Linux/Unix and Windows**: From d447fe0ca08c97b4c2a6777189c7a0d3f0a02cd4 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 23:15:59 +1100 Subject: [PATCH 47/53] Only use the xunit runner when we really have to. --- ci-test.ps1 | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/ci-test.ps1 b/ci-test.ps1 index c45074329f..fe470a04be 100644 --- a/ci-test.ps1 +++ b/ci-test.ps1 @@ -9,6 +9,8 @@ param( [string]$codecov ) + $netFxRegex = '^net\d+' + if ($codecov -eq 'true') { # xunit doesn't understand custom params so use dotnet test. @@ -17,29 +19,19 @@ if ($codecov -eq 'true') { dotnet clean -c Debug dotnet test -c Debug -f $targetFramework /p:codecov=true } -elseif ($os -ne 'windows-latest') { - # xunit doesn't run without mono on linux and macos. - dotnet test --no-build -c Release -f $targetFramework -} -else { - - # xunit has issues matching the correct installed runtime if we do not specify it explicitly. - # https://github.com/xunit/xunit/issues/1476 - # This fix assumes the base version is installed. - $coreTargetFrameworkRegex = '^netcoreapp(\d+\.\d+)$' - if ($targetFramework -match $coreTargetFrameworkRegex) { - $fxVersion = "--fx-version ${matches[1]}.0" - } +elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) { + # xunit doesn't run on core with NET SDK 3.1+. + # xunit doesn't actually understand -x64 as an option. + # # xunit requires explicit path. Set-Location $env:XUNIT_PATH - # xunit doesn't actually understand -x64 as an option. - if ($platform -ne '-x86') { - $platform = '' - } - dotnet xunit --no-build -c Release -f $targetFramework ${fxVersion} $platform Set-Location $PSScriptRoot } +else { + + dotnet test --no-build -c Release -f $targetFramework +} From ed53c8289917f89e7c64cfb54846213166e52883 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 16 Jan 2020 23:42:22 +1100 Subject: [PATCH 48/53] Restore CI variable and skip troublesome tests --- .github/workflows/build-and-test.yml | 1 + tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e7f4a143b4..4cb40d36a0 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -82,6 +82,7 @@ jobs: shell: pwsh run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" env: + CI : True XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit - name: Update Codecov diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index 41576cc0df..6aaa0c80ce 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -181,6 +181,12 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png public void WorksWithAllBitDepths(TestImageProvider provider, PngColorType pngColorType, PngBitDepth pngBitDepth) where TPixel : struct, IPixel { + // TODO: Investigate WuQuantizer to see if we can reduce memory pressure. + if (TestEnvironment.RunsOnCI && !TestEnvironment.Is64BitProcess) + { + return; + } + foreach (PngInterlaceMode interlaceMode in InterlaceMode) { TestPngEncoderCore( @@ -201,7 +207,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png where TPixel : struct, IPixel { // TODO: Investigate WuQuantizer to see if we can reduce memory pressure. - if (!TestEnvironment.Is64BitProcess) + if (TestEnvironment.RunsOnCI && !TestEnvironment.Is64BitProcess) { return; } From 19291c1234c5e62a11fc7844c96579e2b67e9f48 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 17 Jan 2020 00:40:31 +1100 Subject: [PATCH 49/53] Delete bak file and undo bad gitignore changes --- .github/workflows/build-and-test.yml.bak | 116 ----------------------- .gitignore | 4 +- 2 files changed, 1 insertion(+), 119 deletions(-) delete mode 100644 .github/workflows/build-and-test.yml.bak diff --git a/.github/workflows/build-and-test.yml.bak b/.github/workflows/build-and-test.yml.bak deleted file mode 100644 index 7d7d2ad26b..0000000000 --- a/.github/workflows/build-and-test.yml.bak +++ /dev/null @@ -1,116 +0,0 @@ -name: Build - -on: - push: - branches: - - master - tags: - - "v*" - pull_request: - branches: - - master - -jobs: - Coverage: - runs-on: windows-latest - needs: [Build] - steps: - - uses: actions/checkout@v1 - - - name: Install nuget - uses: NuGet/setup-nuget@v1 - - - name: Enable long file paths - run: git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init --recursive - - - name: Generate Test Coverage - shell: pwsh - run: ./tests/CodeCoverage/CodeCoverage.ps1 - env: - CI: True - - - name: Update codecov - uses: iansu/codecov-action-node@v1.0.0 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: "ImageSharp.Coverage.xml" - flags: unittests - - Build: - strategy: - matrix: - opts: - - os: ubuntu-latest - framework: netcoreapp2.1 - is32Bit: False - doCoverage: False - - os: windows-latest - framework: netcoreapp2.1 - is32Bit: False - doCoverage: True - - os: windows-latest - framework: net472 - is32Bit: False - doCoverage: False - - os: windows-latest - framework: net472 - is32Bit: True - doCoverage: False - - runs-on: ${{ matrix.opts.os }} - - steps: - - uses: actions/checkout@v1 - - - name: install nuget - uses: NuGet/setup-nuget@v1 - - - name: Enable long file paths - run: | - git config --global core.autocrlf false - git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init - - - name: Build - shell: pwsh - run: | - $DebugPreference = "Continue" - ./build.ps1 "${{matrix.opts.framework}}" - - - name: Test - shell: pwsh - run: ./run-tests.ps1 "${{ matrix.opts.os }}" "${{matrix.opts.framework}}" "${{matrix.opts.is32Bit}}" "${{matrix.opts.doCoverage}}" - env: - CI: True - - Publish: - runs-on: windows-latest - needs: [Build] - if: github.event_name == 'push' - steps: - - uses: actions/checkout@v1 - - - name: install nuget - uses: NuGet/setup-nuget@v1 - - - name: Enable long file paths - run: git config --global core.longpaths true - - - name: Update submodules - run: git submodule -q update --init --recursive - - - name: Build - shell: pwsh - run: | - $DebugPreference = "Continue" - ./build.ps1 - - - name: Publish to nightly feed -myget - if: success() - run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package - # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org diff --git a/.gitignore b/.gitignore index 4007b1faba..8fcb5ef405 100644 --- a/.gitignore +++ b/.gitignore @@ -137,7 +137,7 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings +# TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj @@ -221,5 +221,3 @@ artifacts/ # Tests **/Images/ActualOutput **/Images/ReferenceOutput -/tests/CodeCoverage/opencover.zip -/tests/CodeCoverage/OpenCover.4.6.519 From b88dd992bb7fc399540cf659811be7990a32a9c1 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 17 Jan 2020 11:37:15 +1100 Subject: [PATCH 50/53] Speed up coverage and respond to comments --- ci-test.ps1 | 16 ++++++++-------- src/ImageSharp/Advanced/AotCompilerTools.cs | 2 ++ tests/Directory.Build.targets | 6 +++--- .../ImageSharp.Benchmarks.csproj | 1 + 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ci-test.ps1 b/ci-test.ps1 index fe470a04be..c9cfc07a37 100644 --- a/ci-test.ps1 +++ b/ci-test.ps1 @@ -6,18 +6,18 @@ param( [Parameter(Mandatory, Position = 2)] [string]$platform, [Parameter(Mandatory, Position = 3)] - [string]$codecov + [string]$codecov, + [Parameter(Position = 4)] + [string]$codecovProfile = 'Release' ) - $netFxRegex = '^net\d+' +$netFxRegex = '^net\d+' if ($codecov -eq 'true') { - # xunit doesn't understand custom params so use dotnet test. - # Coverage tests are run in debug because the coverage tools are triggering a JIT error in filter processors - # that causes the blue component of transformed values to be corrupted. - dotnet clean -c Debug - dotnet test -c Debug -f $targetFramework /p:codecov=true + # Allow toggling of profile to workaround any potential JIT errors caused by code injection. + dotnet clean -c $codecovProfile + dotnet test -c $codecovProfile -f $targetFramework /p:codecov=true } elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) { @@ -31,7 +31,7 @@ elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) { Set-Location $PSScriptRoot } -else { +else { dotnet test --no-build -c Release -f $targetFramework } diff --git a/src/ImageSharp/Advanced/AotCompilerTools.cs b/src/ImageSharp/Advanced/AotCompilerTools.cs index 60c1f4178a..bb4ddb7d0c 100644 --- a/src/ImageSharp/Advanced/AotCompilerTools.cs +++ b/src/ImageSharp/Advanced/AotCompilerTools.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Formats; @@ -19,6 +20,7 @@ namespace SixLabors.ImageSharp.Advanced /// None of the methods in this class should ever be called, the code only has to exist at compile-time to be picked up by the AoT compiler. /// (Very similar to the LinkerIncludes.cs technique used in Xamarin.Android projects.) /// + [ExcludeFromCodeCoverage] internal static class AotCompilerTools { static AotCompilerTools() diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 40347763d9..26baee07e3 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -29,7 +29,7 @@ true true opencover - + $(MSBuildThisFileDirectory)..\coverage.xml @@ -40,8 +40,8 @@ - - + + diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index 34f517500c..edadf711de 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -8,6 +8,7 @@ netcoreapp3.1;netcoreapp2.1;net472 false + false From e1f6362f5b4fda7ce44f4377c4a3a5d49413ee30 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 17 Jan 2020 12:10:37 +1100 Subject: [PATCH 51/53] Update ci-test.ps1 --- ci-test.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci-test.ps1 b/ci-test.ps1 index c9cfc07a37..fc368b22fb 100644 --- a/ci-test.ps1 +++ b/ci-test.ps1 @@ -35,3 +35,7 @@ else { dotnet test --no-build -c Release -f $targetFramework } + +# Explicitly exit with 0 to ignore errors caused by coverlet attempting to read +# project files that dotnet test is set to ignore. +exit 0 From 0cb40d1a86f70dbc076a8b235b61d69f93f6bf22 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 17 Jan 2020 16:03:23 +1100 Subject: [PATCH 52/53] Fix netstandard 1.3 build --- Directory.Build.props | 45 ++++++++++--------- Directory.Build.targets | 3 -- ImageSharp.sln | 6 +++ shared-infrastructure | 2 +- src/ImageSharp/ImageSharp.csproj | 6 +-- .../ImageSharp.Benchmarks.csproj | 1 - 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e4e52ac164..cd2f7311ef 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -31,33 +31,36 @@ - - $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS; + + $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;SUPPORTS_CODECOVERAGE - - $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING + + $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE - - $(DefineConstants);SUPPORTS_MATHF; + + $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_CODECOVERAGE - - $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING + + $(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE - - $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS + + $(DefineConstants);SUPPORTS_CODECOVERAGE + + + $(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_CODECOVERAGE diff --git a/Directory.Build.targets b/Directory.Build.targets index f69a873acc..eb0764d899 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -24,9 +24,6 @@ - - - diff --git a/ImageSharp.sln b/ImageSharp.sln index 2adc18f46d..875ede1b2d 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -329,7 +329,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml EndProjectSection EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedInfrastructure", "shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.shproj", "{68A8CC40-6AED-4E96-B524-31B1158FDEEA}" +EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems*{68a8cc40-6aed-4e96-b524-31b1158fdeea}*SharedItemsImports = 13 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 @@ -412,6 +417,7 @@ Global {2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {561B880A-D9EE-44EF-90F5-817C54A9D9AB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {C0D7754B-5277-438E-ABEB-2BA34401B5A7} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D} + {68A8CC40-6AED-4E96-B524-31B1158FDEEA} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795} diff --git a/shared-infrastructure b/shared-infrastructure index 40f740dea2..36b2d55f5b 160000 --- a/shared-infrastructure +++ b/shared-infrastructure @@ -1 +1 @@ -Subproject commit 40f740dea2aad9dabae12a8e1e17fdcf476066ba +Subproject commit 36b2d55f5bb0d91024955bd26ba220ee41cc96e5 diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index f13989acdc..a6beac7258 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -19,10 +19,6 @@ SixLabors.ImageSharp - - - - True @@ -207,4 +203,6 @@ + + diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index edadf711de..60b1fde8e0 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -21,7 +21,6 @@ - From 937b4d37de3a8c4f6cf8bcf69901463855f64a71 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 18 Jan 2020 09:22:57 +1100 Subject: [PATCH 53/53] Temporarily disable Stylecop in tests --- Directory.Build.props | 3 ++- src/Directory.Build.props | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index cd2f7311ef..346da14be8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -102,7 +102,8 @@ - + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0bddf7e696..5e3f9b0618 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -25,8 +25,11 @@ true - + + + +