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
38 changes: 38 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# How to contribute to SixLabors.PolygonClipper

#### **Did you find a bug?**

- Please **ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/SixLabors/PolygonClipper/issues).

- If you're unable to find an open issue addressing the problem, please [open a new one](https://github.com/SixLabors/PolygonClipper/issues/new). Be sure to include a **title, the applicable version, a clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. Please do not hijack existing issues.

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

* Before submitting, please ensure that your code matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.

#### **Do you intend to add a new feature or change an existing one?**

* Suggest your change in the [Ideas Discussions Channel](https://github.com/SixLabors/PolygonClipper/discussions?discussions_q=category%3AIdeas) and start writing code.

* Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes.

#### **Building**

* When first cloning the repo, make sure to run `git submodule update --init --recursive` otherwise the submodules (e.g. `shared-infrastructure`) will be missing.

* Run `dotnet build` in the root of the repo, or open the PolygonClipper.sln file in Visual Studio and build from there.

#### **Do you have questions about consuming the library or the source code?**

* Ask any question about how to use SixLabors.PolygonClipper in the [Help Discussions Channel](https://github.com/SixLabors/PolygonClipper/discussions?discussions_q=category%3AHelp).

#### Code of Conduct
This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/) to clarify expected behavior in our community.

And please remember. SixLabors.PolygonClipper is the work of a very, very, small number of developers who struggle balancing time to contribute to the project with family time and work commitments. We encourage you to pitch in and help make our vision of simple accessible image processing available to all. Open Source can only exist with your help.

Thanks for reading!
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: SixLabors
open_collective: sixlabors
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Questions
url: https://github.com/SixLabors/PolygonClipper/discussions/categories/q-a
about: Ask the community for help.
- name: Feature Request
url: https://github.com/SixLabors/PolygonClipper/discussions/categories/ideas
about: Share ideas for new features for this project.
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/oss-bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Bug Report"
description: Create a report to help us improve the project. Issues are not guaranteed to be triaged.
labels: ["needs triage"]
body:
- type: checkboxes
attributes:
label: Prerequisites
options:
- label: I have written a descriptive issue title
required: true
- label: I have verified that I am running the latest version of PolygonClipper
required: true
- label: I have verified if the problem exist in both `DEBUG` and `RELEASE` mode
required: true
- label: I have searched [open](https://github.com/SixLabors/PolygonClipper/issues) and [closed](https://github.com/SixLabors/PolygonClipper/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported
required: true
- type: input
attributes:
label: PolygonClipper version
validations:
required: true
- type: input
attributes:
label: Environment (Operating system, version and so on)
validations:
required: true
- type: input
attributes:
label: .NET Framework version
validations:
required: true
- type: textarea
attributes:
label: Description
description: A description of the bug
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: List of steps, sample code, failing test or link to a project that reproduces the behavior. Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues.
validations:
required: true
- type: textarea
attributes:
label: Images
description: Please upload images that can be used to reproduce issues in the area below. If the file type is not supported the file can be zipped and then uploaded instead.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Prerequisites

- [ ] I have written a descriptive pull-request title
- [ ] I have verified that there are no overlapping [pull-requests](https://github.com/SixLabors/PolygonClipper/pulls) open
- [ ] I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
- [ ] I have provided test coverage for my change (where applicable)

### Description
<!-- A description of the changes proposed in the pull-request -->

<!-- Thanks for contributing to PolygonClipper! -->
146 changes: 93 additions & 53 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,52 @@ on:
- release/*
types: [ labeled, opened, synchronize, reopened ]
jobs:
# Prime a single LFS cache and expose the exact key for the matrix
WarmLFS:
runs-on: ubuntu-latest
outputs:
lfs_key: ${{ steps.expose-key.outputs.lfs_key }}
steps:
- name: Git Config
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.longpaths true

- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

# Deterministic list of LFS object IDs, then compute a portable key:
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
# - `awk '{print $1}'` extracts just the SHA field
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
# This ensures the file content is identical regardless of OS or locale
- name: Git Create LFS id list
shell: bash
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id

- name: Git Expose LFS cache key
id: expose-key
shell: bash
env:
LFS_KEY: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
run: echo "lfs_key=$LFS_KEY" >> "$GITHUB_OUTPUT"

- name: Git Setup LFS Cache
uses: actions/cache@v4
with:
path: .git/lfs
key: ${{ steps.expose-key.outputs.lfs_key }}

- name: Git Pull LFS
shell: bash
run: git lfs pull

Build:
needs: WarmLFS
Comment thread
JimBobSquarePants marked this conversation as resolved.
strategy:
matrix:
options:
Expand Down Expand Up @@ -67,16 +112,12 @@ jobs:
fetch-depth: 0
submodules: recursive

# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
- name: Git Create LFS FileList
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

# Use the warmed key from WarmLFS. Do not recompute or recreate .lfs-assets-id here.
- name: Git Setup LFS Cache
uses: actions/cache@v4
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
key: ${{ needs.WarmLFS.outputs.lfs_key }}

- name: Git Pull LFS
run: git lfs pull
Expand Down Expand Up @@ -136,51 +177,50 @@ jobs:
SIXLABORS_TESTING_PREVIEW: True
XUNIT_PATH: .\tests\PolygonClipper.Tests # Required for xunit

# Publish:
# needs: [Build]

# runs-on: ubuntu-latest

# if: (github.event_name == 'push')

# steps:
# - name: Git Config
# shell: bash
# run: |
# git config --global core.autocrlf false
# git config --global core.longpaths true

# - name: Git Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# submodules: recursive

# - name: NuGet Install
# uses: NuGet/setup-nuget@v2

# - name: NuGet Setup Cache
# uses: actions/cache@v4
# id: nuget-cache
# with:
# path: ~/.nuget
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
# restore-keys: ${{ runner.os }}-nuget-

# - name: DotNet Pack
# shell: pwsh
# run: ./ci-pack.ps1

# - name: Feedz Publish
# shell: pwsh
# run: |
# dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate
# dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate

# - name: NuGet Publish
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
# shell: pwsh
# run: |
# dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
# dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
Publish:
needs: [Build]

runs-on: ubuntu-latest

if: (github.event_name == 'push')

steps:
- name: Git Config
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.longpaths true

- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

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

- name: NuGet Setup Cache
uses: actions/cache@v4
id: nuget-cache
with:
path: ~/.nuget
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
restore-keys: ${{ runner.os }}-nuget-

- name: DotNet Pack
shell: pwsh
run: ./ci-pack.ps1

- name: Feedz Publish
shell: pwsh
run: |
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate

- name: NuGet Publish
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: pwsh
run: |
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
20 changes: 13 additions & 7 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
schedule:
# 2AM every Tuesday/Thursday
- cron: "0 2 * * 2,4"

jobs:
Build:
strategy:
Expand All @@ -14,7 +15,7 @@ jobs:
runtime: -x64
codecov: true

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

steps:
- name: Git Config
Expand All @@ -29,16 +30,21 @@ jobs:
fetch-depth: 0
submodules: recursive

# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
- name: Git Create LFS FileList
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
# Deterministic list of LFS object IDs, then compute a portable key:
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
# - `awk '{print $1}'` extracts just the SHA field
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
# This ensures the file content is identical regardless of OS or locale
- name: Git Create LFS id list
shell: bash
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id

- name: Git Setup LFS Cache
uses: actions/cache@v4
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1

- name: Git Pull LFS
run: git lfs pull
Expand All @@ -62,13 +68,13 @@ jobs:

- name: DotNet Build
shell: pwsh
run: ./ci-build.ps1 "${{matrix.options.framework}}"
run: ./ci-build.ps1 "${{ matrix.options.framework }}"
env:
SIXLABORS_TESTING: True

- name: DotNet Test
shell: pwsh
run: ./ci-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:
SIXLABORS_TESTING: True
XUNIT_PATH: .\tests\PolygonClipper.Tests # Required for xunit
Expand Down
2 changes: 1 addition & 1 deletion PolygonClipper.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!--Add common namespaces to implicit global usings if enabled.-->
<ItemGroup Condition="'$(UsePolygonClipper)'=='enable' OR '$(UsePolygonClipper)'=='true'">
<Using Include="PolygonClipper" />
<Using Include="SixLabors.PolygonClipper" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions PolygonClipper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeoJson", "tests\GeoJson\GeoJson.csproj", "{F881441F-D3B6-4B48-8CEF-8DC0746D4578}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{6F7A3AE6-C7D1-441F-A203-BA6575931CE2}"
ProjectSection(SolutionItems) = preProject
.github\CONTRIBUTING.md = .github\CONTRIBUTING.md
.github\dependabot.yml = .github\dependabot.yml
.github\FUNDING.yml = .github\FUNDING.yml
.github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{EEA3B5E9-3337-42EE-B0BF-FA586A1BC435}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -36,6 +42,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PolygonClipper.Benchmarks",
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedInfrastructure", "shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.shproj", "{68A8CC40-6AED-4E96-B524-31B1158FDEEA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
ProjectSection(SolutionItems) = preProject
.github\ISSUE_TEMPLATE\config.yml = .github\ISSUE_TEMPLATE\config.yml
.github\ISSUE_TEMPLATE\oss-bug-report.yml = .github\ISSUE_TEMPLATE\oss-bug-report.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -70,6 +82,7 @@ Global
{EEA3B5E9-3337-42EE-B0BF-FA586A1BC435} = {6F7A3AE6-C7D1-441F-A203-BA6575931CE2}
{F1965B36-D896-4BC1-8941-7FE6CEB82CD5} = {84C4B358-492B-46FC-9F11-FBB76B06BD3F}
{68A8CC40-6AED-4E96-B524-31B1158FDEEA} = {F0882E95-667C-48FE-B43A-24FC55D9F354}
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {6F7A3AE6-C7D1-441F-A203-BA6575931CE2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2C73BEEC-091B-45E4-A0BD-7D7CD16A8451}
Expand Down
Loading
Loading