Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,24 @@
# Set explicit file behavior to:
# 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
*.ttf binary
*.woff binary
*.woff2 binary
Expand Down
212 changes: 102 additions & 110 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,113 +1,105 @@
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 : 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

- 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 : 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.options.framework}}"

- name: Test
shell: pwsh
run: ./run-tests.ps1 "${{ matrix.options.os }}" "${{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 : 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

- 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
Build:
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: windows-latest
framework: net472
runtime: -x64
codecov: false
- os: windows-latest
framework: net472
runtime: -x86
codecov: false

runs-on: ${{matrix.options.os}}

steps:
- uses: actions/checkout@v2

- name: Install NuGet
uses: NuGet/setup-nuget@v1

- name: Setup Git
shell: bash
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: 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

- 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}}"

- name: Test
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.Drawing.Tests # Required for xunit

- name: Update Codecov
uses: iansu/codecov-action-node@v1.0.0
if: matrix.options.codecov == true
with:
token: ${{secrets.CODECOV_TOKEN}}
file: "coverage.${{matrix.options.framework}}.xml"
flags: unittests

- 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}}"

- 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
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
[submodule "tests/Images/External"]
path = tests/Images/External
url = https://github.com/SixLabors/Imagesharp.Tests.Images.git
branch = master
[submodule "branding"]
path = branding
url = https://github.com/SixLabors/Branding
branch = master
22 changes: 0 additions & 22 deletions CodeCoverage.runsettings

This file was deleted.

58 changes: 32 additions & 26 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,36 @@

<!--
https://apisof.net/
+===================+================+===================+==============================+======================+==========================+
| Target Framework | SUPPORTS_MATHF | SUPPORTS_HASHCODE | SUPPORTS_EXTENDED_INTRINSICS | SUPPORTS_SPAN_STREAM | SUPPORTS_ENCODING_STRING |
+===================+================+===================+==============================+======================+==========================+
| netcoreapp3.1 | Y | Y | Y | Y | Y |
| netcoreapp2.1 | Y | Y | Y | Y | Y |
| netcoreapp2.0 | Y | N | N | N | N |
| netstandard2.1 | Y | N | N | Y | Y |
| netstandard2.0 | N | N | N | N | N |
| netstandard1.3 | N | N | N | N | N |
| net472 | N | N | Y | N | N |
+===================+================+===================+==============================+======================+==========================+
+===================+=======+==========+=====================+=============+=================+====================+==============+
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE |
+===================+=======+==========+=====================+=============+=================+====================+==============+
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y |
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y |
| netcoreapp2.0 | Y | N | N | N | N | N | Y |
| netstandard2.1 | Y | Y | N | Y | Y | N | Y |
| netstandard2.0 | N | N | N | N | N | N | Y |
| netstandard1.3 | N | N | N | N | N | N | N |
| net472 | N | N | Y | N | N | N | Y |
+===================+=======+==========+=====================+=============+=================+====================+==============+
-->

<!-- TODO: Include additional targets to TargetFrameworks -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_CODECOVERAGE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
</PropertyGroup>

<!-- Default settings that explicitly differ from the Sdk.targets defaults-->
Expand All @@ -79,27 +81,31 @@
<Copyright>Copyright © Six Labors and Contributors</Copyright>
<Features>strict;IOperation</Features>
<HighEntropyVA>true</HighEntropyVA>
<LangVersion>7.3</LangVersion>
<LangVersion>8.0</LangVersion>
<NeutralLanguage>en</NeutralLanguage>
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
<!--Icon source is set in src folder props file-->
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<RepositoryType>git</RepositoryType>
<RestoreSources>
https://www.myget.org/F/sixlabors/api/v3/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://api.nuget.org/v3/index.json;
</RestoreSources>
<SixLaborsPublicKey>002400000c8000009400000006020000002400005253413100040000010001000147e6fe6766715eec6cfed61f1e7dcdbf69748a3e355c67e9d8dfd953acab1d5e012ba34b23308166fdc61ee1d0390d5f36d814a6091dd4b5ed9eda5a26afced924c683b4bfb4b3d64b0586a57eff9f02b1f84e3cb0ddd518bd1697f2c84dcbb97eb8bb5c7801be12112ed0ec86db934b0e9a5171e6bb1384b6d2f7d54dfa97</SixLaborsPublicKey>
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>

<!-- Package references which are consumed by all projects -->
<!-- Package references and additional files which are consumed by all projects -->
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" IsImplicitlyDefined="true" />
<!--TODO: Enable this once tests Stylecop issues are fixed-->
<!--<PackageReference Include="StyleCop.Analyzers" IsImplicitlyDefined="true" />-->
<AdditionalFiles Include="$(MSBuildThisFileDirectory)shared-infrastructure\stylecop.json" />
<!--NuGet package icon source-->
<None Include="$(MSBuildThisFileDirectory)shared-infrastructure\branding\icons\imagesharp.drawing\sixlabors.imagesharp.drawing.128.png" Pack="true" PackagePath="\icon.png" />
</ItemGroup>

</Project>
Loading