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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
pull_request:
push:
branches:
- master

permissions:
contents: read

jobs:
build-test-pack:
name: Restore, build, test, pack
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore
run: dotnet restore IntervalTree.Net.sln

- name: Build
run: dotnet build IntervalTree.Net.sln --configuration Release --no-restore

- name: Test
run: dotnet test IntervalTree.Net.sln --configuration Release --no-build

- name: Pack
run: dotnet pack src/IntervalTree.Net/IntervalTree.Net.csproj --configuration Release --no-build --output artifacts/packages
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bin/
obj/
TestResults/
artifacts/
*.nupkg
*.snupkg
.vs/
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ Thank you for your interest in contributing to **IntervalTree.Net**. This libra
```
3. Restore dependencies and build the project:
```bash
dotnet restore tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj
dotnet build tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj --configuration Release --no-restore
dotnet restore IntervalTree.Net.sln
dotnet build IntervalTree.Net.sln --configuration Release --no-restore
```
4. Run tests to verify your environment:
```bash
dotnet test tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj --configuration Release --no-build
dotnet test IntervalTree.Net.sln --configuration Release --no-build
```

## Build and Test Instructions

- **Building**: Use `dotnet build tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj --configuration Release` to compile the library and test project. The library project includes no external dependencies.
- **Testing**: All new features must include unit tests. Tests should be added to the existing xUnit project under `tests/IntervalTree.Net.Tests/`. Run `dotnet test tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj --configuration Release` to execute the test suite.
- **Continuous Integration**: No GitHub Actions workflow is currently configured. Run restore, build and test locally before requesting a review.
- **Building**: Use `dotnet build IntervalTree.Net.sln --configuration Release` to compile the library and test project. The library project includes no external dependencies.
- **Testing**: All new features must include unit tests. Tests should be added to the existing xUnit project under `tests/IntervalTree.Net.Tests/`. Run `dotnet test IntervalTree.Net.sln --configuration Release` to execute the test suite.
- **Package validation**: Use `dotnet pack src/IntervalTree.Net/IntervalTree.Net.csproj --configuration Release --no-build` to create a local package for inspection. Do not publish packages from local validation.
- **Continuous Integration**: Pull requests and pushes to `master` run restore, build, test and pack validation. The workflow does not publish packages or require secrets.

## Coding Style

Expand Down
36 changes: 36 additions & 0 deletions IntervalTree.Net.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7023B4F2-3045-413B-88B8-908AB23D8194}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntervalTree.Net", "src\IntervalTree.Net\IntervalTree.Net.csproj", "{1D52A0D8-2208-4855-8944-BE41B1A411C1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{EA74D3EA-0B86-4536-8B27-4C2E528008E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntervalTree.Net.Tests", "tests\IntervalTree.Net.Tests\IntervalTree.Net.Tests.csproj", "{EA92A05C-2EC2-41F0-9DFB-72A5D3AFF385}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1D52A0D8-2208-4855-8944-BE41B1A411C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D52A0D8-2208-4855-8944-BE41B1A411C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D52A0D8-2208-4855-8944-BE41B1A411C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D52A0D8-2208-4855-8944-BE41B1A411C1}.Release|Any CPU.Build.0 = Release|Any CPU
{EA92A05C-2EC2-41F0-9DFB-72A5D3AFF385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA92A05C-2EC2-41F0-9DFB-72A5D3AFF385}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA92A05C-2EC2-41F0-9DFB-72A5D3AFF385}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA92A05C-2EC2-41F0-9DFB-72A5D3AFF385}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1D52A0D8-2208-4855-8944-BE41B1A411C1} = {7023B4F2-3045-413B-88B8-908AB23D8194}
{EA92A05C-2EC2-41F0-9DFB-72A5D3AFF385} = {EA74D3EA-0B86-4536-8B27-4C2E528008E4}
EndGlobalSection
EndGlobal
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ Naïve range queries require scanning every interval, which is \(O(n)\) time per

## Installation

IntervalTree.Net is not currently published to NuGet. For local development, restore and build the test project directly:
IntervalTree.Net is not currently published to NuGet. For local development, restore and build the solution:

```shell
dotnet restore tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj
dotnet build tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj --configuration Release --no-restore
dotnet test tests/IntervalTree.Net.Tests/IntervalTree.Net.Tests.csproj --configuration Release --no-build
dotnet restore IntervalTree.Net.sln
dotnet build IntervalTree.Net.sln --configuration Release --no-restore
dotnet test IntervalTree.Net.sln --configuration Release --no-build
dotnet pack src/IntervalTree.Net/IntervalTree.Net.csproj --configuration Release --no-build
```

The library targets **net8.0** and uses modern C# features. The library project has no additional package dependencies. NuGet publishing is not approved or completed in the current repository state.
Expand Down
13 changes: 13 additions & 0 deletions src/IntervalTree.Net/IntervalTree.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,18 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<PackageId>IntervalTree.Net</PackageId>
<Version>0.1.0</Version>
<Authors>Courtland Hacker</Authors>
<Description>A small .NET interval tree library for half-open interval storage and overlap queries.</Description>
<PackageTags>interval-tree;intervals;range-query;data-structures;dotnet</PackageTags>
<RepositoryUrl>https://github.com/Courtland9777/IntervalTree.Net</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="/" />
</ItemGroup>
</Project>
Loading