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
108 changes: 108 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Default: auto-detect text and normalise to LF in the index.
# Everything below only overrides the *working tree* checkout behaviour.
* text=auto

# ---------------------------------------------------------------------------
# .NET source and project files
# No eol= means each dev's core.autocrlf / core.eol decides. Set eol=lf here
# instead if you want to hard-enforce LF everywhere -- but keep it in sync
# with end_of_line in .editorconfig or `dotnet format --verify-no-changes`
# will fail in CI.
# ---------------------------------------------------------------------------
*.cs text diff=csharp
*.csx text diff=csharp
*.vb text
*.fs text
*.fsx text
*.csproj text
*.fsproj text
*.vbproj text
*.props text
*.targets text
*.resx text
*.config text
*.ruleset text
*.xaml text
*.cshtml text diff=html
*.razor text diff=html
*.sln text eol=lf
*.slnx text eol=lf

# ---------------------------------------------------------------------------
# Data, config and docs
# ---------------------------------------------------------------------------
*.json text
*.xml text
*.yml text
*.yaml text
*.toml text
*.md text diff=markdown
*.svg text
*.editorconfig text
.gitattributes text
.gitignore text

# ---------------------------------------------------------------------------
# Web assets (only relevant if the repo ships any)
# ---------------------------------------------------------------------------
*.js text
*.jsx text
*.ts text
*.tsx text
*.html text diff=html
*.css text
*.scss text

# ---------------------------------------------------------------------------
# Scripts -- these MUST be pinned regardless of platform.
# cmd.exe misparses LF in multi-line blocks and labels; sh needs LF.
# ---------------------------------------------------------------------------
*.sh text eol=lf
*.bash text eol=lf
*.zsh text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=lf
*.psm1 text eol=lf
*.psd1 text eol=lf
Dockerfile text eol=lf
*.dockerfile text eol=lf
justfile text eol=lf
Makefile text eol=lf

# Patches carry their own endings -- never touch them.
*.patch -text

# ---------------------------------------------------------------------------
# Binary
# ---------------------------------------------------------------------------
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.webp binary
*.mp4 binary
*.zip binary
*.gz binary
*.7z binary
*.tar binary
*.exe binary
*.dll binary
*.pdb binary
*.obj binary
*.vsix binary
*.nupkg binary
*.snupkg binary
*.snk binary
*.pfx binary
*.lockb binary
*.woff binary
*.woff2 binary

# ---------------------------------------------------------------------------
# Keep repo scaffolding out of `git archive` / source packages
# ---------------------------------------------------------------------------
.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
19 changes: 19 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# GitHub Copilot Instructions

## Primary instruction source

Use the repository root [`AGENTS.md`](../AGENTS.md) as the **primary** source of truth for behavior, architecture context, testing standards, and completion criteria.

If this file and `AGENTS.md` appear to conflict, prefer `AGENTS.md` unless this file explicitly states a GitHub Copilot-only exception.

## Copilot-specific guidance

This file should only contain **GitHub Copilot-specific** instruction details.
Keep product, architecture, and general engineering standards centralized in `AGENTS.md`.

## Operating expectations for Copilot

- Apply the `AGENTS.md` testing bar strictly (TUnit/TUnit.Mocks, AAA comments, naming, cancellation token rule).
- Treat work as incomplete until relevant tests pass.
- Consult the repository `.agents/` folder for additional skills/workflows that may improve execution quality.
- Keep edits minimal, focused, and aligned with existing SDK and repository conventions.
28 changes: 28 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR

on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true

- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: "10.0.x"

- name: Run PR pipeline
run: dotnet run --project build/PipelineCLI/PipelineCLI.csproj --configuration Release
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
name: Release packages
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true

- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: "10.0.x"

- name: Check for version bump
id: version
shell: bash
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Version $VERSION is already tagged as $TAG. Skipping release."
echo "should_publish=false" >> "$GITHUB_OUTPUT"
else
echo "New version $VERSION detected. Releasing $TAG."
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
fi

- name: Run release pipeline
if: steps.version.outputs.should_publish == 'true'
env:
Release__ShouldPublish: true
NuGet__ApiKey: ${{ secrets.NUGET_API_KEY }}
run: dotnet run --project build/PipelineCLI/PipelineCLI.csproj --configuration Release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,4 @@ sketch

BenchmarkDotNet.Artifacts/
!**/Sdk/build
!build/
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Agent Instructions

This repository contains custom build rules, analysers, and source generators. Agents working in this codebase should follow the guidelines below.

## Warnings and Suggestions

Do **not** suppress or mute compiler, analyser, or build warnings by adding `<NoWarn>` entries, `#pragma warning disable`, or similar directives in code or project files without explicit user direction. Warnings and suggestions are the responsibility of the developer/user to evaluate and mute. If a warning is raised, surface it to the user and let them decide whether to suppress it.
23 changes: 14 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@
<PropertyGroup>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<RoslynCompilerVersion Condition="'$(RoslynCompilerVersion)' == ''">[4.13.0,)</RoslynCompilerVersion>
<RoslynAnalyzersVersion Condition="'$(RoslynAnalyzersVersion)' == ''">[5.6.0,)</RoslynAnalyzersVersion>
<TUnitVersion>[1.61.0,)</TUnitVersion>
<RoslynAnalyzersVersion Condition="'$(RoslynAnalyzersVersion)' == ''">[5.9.0,)</RoslynAnalyzersVersion>
<TUnitVersion>[1.65.51,)</TUnitVersion>
<ModularPipelinesVersion>[3.2.8,)</ModularPipelinesVersion>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="ModularPipelines" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="ModularPipelines.DotNet" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="ModularPipelines.Git" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="ModularPipelines.GitHub" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="NuGet.Packaging" Version="7.9.0" />
<PackageVersion Include="NuGet.Versioning" Version="7.9.0" />
<PackageVersion Include="Bogus" Version="[35.6.5,)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[10.0.9,)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[10.0.300,)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[10.0.400,)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="$(RoslynCompilerVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslynCompilerVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(RoslynAnalyzersVersion)" />
<PackageVersion Include="TUnit" Version="$(TUnitVersion)" />
<PackageVersion Include="TUnit.Core" Version="$(TUnitVersion)" />
<PackageVersion Include="TUnit.Assertions" Version="$(TUnitVersion)" />
<PackageVersion Include="TUnit.Mocks" Version="$(TUnitVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[10.0.0,)" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[8.0.0,)" />
<PackageVersion Include="System.Collections.Immutable" Version="[8.0.0,)" />
<PackageVersion Include="BenchmarkDotNet" Version="[0.14.0,)" />
</ItemGroup>
</Project>
61 changes: 59 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,108 @@ solution := root_folder / "SourceGeneratorFramework.slnx"
build_configuration := "Release"
artifacts_folder := "./artifacts"
default_test_filter := "/*/*/*/*/"
pipeline_solution := "build/Pipeline.slnx"
pipeline_project := "build/PipelineCLI/PipelineCLI.csproj"

current_version := `node -p "require('./package.json').version"`

[private]
default:
just --list

# Run the PR pipeline (restore, build, lint, tests)
[group('Pipeline')]
pipeline-pr *args:
echo "Running PR pipeline..."
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} {{ args }}

# Run the build pipeline (restore, build, lint)
[group('Pipeline')]
pipeline-build *args:
echo "Running build pipeline..."
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Build:RunTests=false --Release:Mode=None {{ args }}

# Run the release pipeline (restore, build, lint, tests, pack, publish, GitHub release)
[group('Pipeline')]
pipeline-release *args:
echo "Running release pipeline..."
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Release:Mode=NuGet {{ args }}

# Run the release pipeline (restore, build, lint, tests, pack, local nuget publish)
# Note: `just` runs recipes through the shell, which strips backslashes from unquoted arguments.
# Always use forward slashes for the feed path, e.g.
# just pipeline-local-release --PublishLocalNuGet:LocalFeedPath=p:/_sync-projects/.local-nuget/
[group('Pipeline')]
pipeline-local-release *args:
echo "Running local release pipeline..."
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Release:Mode=LocalNuGet {{ args }}

# Run the pipeline with tests enabled
[group('Pipeline')]
pipeline-tests *args:
echo "Running tests pipeline..."
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Build:RunTests=true --Release:Mode=None {{ args }}

# Build and test with the specified configuration, defaulting to "Release"
[group('Build and Test')]
build solutionOrProject=solution configuration=build_configuration:
echo "Building {{ BLUE }}{{ solutionOrProject }}{{ NORMAL }} with configuration {{ YELLOW }}{{ configuration }}{{ NORMAL }}"
dotnet build {{ solutionOrProject }} -c {{ configuration }}

# Run tests with the specified configuration, defaulting to "Release"
tests solutionOrProject=solution configuration=build_configuration filter=default_test_filter *args:
[group('Build and Test')]
test solutionOrProject=solution configuration=build_configuration filter=default_test_filter *args:
echo "Running tests for {{ BLUE }}{{ solutionOrProject }}{{ NORMAL }} with configuration {{ YELLOW }}{{ configuration }}{{ NORMAL }} and filter {{ GREEN }}{{ filter }}{{ NORMAL }}"
dotnet test {{ solutionOrProject }} -c {{ configuration }} --treenode-filter "{{ filter }}" {{ args }}

# Run tests with the specified configuration, defaulting to "Release"
# Clean all projects with the specified configuration, defaulting to "Release"
[group('Build and Test')]
clean solutionOrProject=solution configuration=build_configuration *args:
echo "Cleaning {{ BLUE }}{{ solutionOrProject }}{{ NORMAL }} with configuration {{ YELLOW }}{{ configuration }}{{ NORMAL }}"
dotnet clean {{ solutionOrProject }} -c {{ configuration }} {{ args }}

# Clean all projects, across Debug and Release configurations
[group('Build and Test')]
clean-all *args:
echo "Cleaning all projects with configuration"
dotnet clean {{ solution }} -c Release {{ args }}
dotnet clean {{ solution }} -c Debug {{ args }}

# Run tests with the specified configuration, defaulting to "Release"
[group('Build and Test')]
restore solutionOrProject=solution:
echo "Restoring dependencies for {{ BLUE }}{{ solutionOrProject }}{{ NORMAL }}"
dotnet restore {{ solutionOrProject }}

# Create NuGet package for the project
[group('Build and Test')]
pack solutionOrProject=solution configuration=build_configuration publish_folder=artifacts_folder:
echo "Packing {{ BLUE }}{{ solutionOrProject }}{{ NORMAL }} with configuration {{ YELLOW }}{{ configuration }}{{ NORMAL }} to {{ GREEN }}{{ publish_folder }}{{ NORMAL }}"
dotnet pack {{ solutionOrProject }} -c {{ configuration }} -o {{ publish_folder }}

# Display the current version of the project
[group('Build and Test')]
version:
echo "Current version: {{ GREEN }}{{ current_version }}{{ NORMAL }}"

# Check code formatting using CSharpier
[group('Utilities')]
lint-check:
dotnet csharpier check .
# dotnet format --verify-no-changes {{ solution }}

# Fix code formatting issues using CSharpier
[group('Utilities')]
lint-fix:
dotnet csharpier format .
# dotnet format {{ solution }}

# Open the solution in Visual Studio/ Registered application
[group('Utilities')]
vs:
open {{ solution }}

# Open the solution in Visual Studio/ Registered application
[group('Utilities')]
vs-pipeline:
open {{ pipeline_solution }}
Loading
Loading