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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ obj/
*.dump
*.mdmp
*.core
/scripts/__pycache__
/scripts/dependencies/__pycache__
16 changes: 16 additions & 0 deletions Docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ dotnet tool update -g docfx
dotnet build ModularityKit.Mutator.slnx -c Release
docfx docfx.json
```

## Common local workflows

The repository root includes a [`Taskfile.yml`](../Taskfile.yml) for use with
[`task`](https://taskfile.dev/) and covers the most common build, test, docs, and verification
commands.

Typical usage:

```bash
task build
task test
task test:smoke
task docs
task verify
```
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@
- [`Docs`](Docs/)
- [`Tests`](Tests/)

## Common workflows

Use the root [`Taskfile.yml`](Taskfile.yml) with [`task`](https://taskfile.dev/) as the preferred
entrypoint for repeated local workflows:

```bash
task build
task test
task test:smoke
task docs
task verify
```

Run `task --list-all` from the repository root to see the full task surface.

## Build

```bash
Expand Down
100 changes: 100 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
version: '3'

vars:
SOLUTION: ModularityKit.Mutator.slnx
CONFIGURATION: '{{default "Release" .CONFIGURATION}}'
CORE_TEST_PROJECT: Tests/ModularityKit.Mutator.Tests/ModularityKit.Mutator.Tests.csproj
GOVERNANCE_TEST_PROJECT: Tests/ModularityKit.Mutator.Governance.Tests/ModularityKit.Mutator.Governance.Tests.csproj
GOVERNANCE_REDIS_TEST_PROJECT: Tests/ModularityKit.Mutator.Governance.Redis.Tests/ModularityKit.Mutator.Governance.Redis.Tests.csproj
SMOKE_TEST_PROJECT: Tests/ModularityKit.Mutator.Examples.SmokeTests/ModularityKit.Mutator.Examples.SmokeTests.csproj

tasks:
default:
desc: List available repository tasks
cmds:
- task --list-all
silent: true

restore:
desc: Restore the solution
cmds:
- dotnet restore {{.SOLUTION}}

clean:
desc: Clean the solution
cmds:
- dotnet clean {{.SOLUTION}} -c {{.CONFIGURATION}}

build:
desc: Build the solution
deps: [restore]
cmds:
- dotnet build {{.SOLUTION}} -c {{.CONFIGURATION}} --no-restore

test:
desc: Run the main test packages and smoke tests
deps:
- test:core
- test:governance
- test:governance:redis
- test:smoke

test:core:
desc: Run core runtime tests
deps: [restore]
cmds:
- dotnet test {{.CORE_TEST_PROJECT}} -c {{.CONFIGURATION}} --no-restore

test:governance:
desc: Run governance tests
deps: [restore]
cmds:
- dotnet test {{.GOVERNANCE_TEST_PROJECT}} -c {{.CONFIGURATION}} --no-restore

test:governance:redis:
desc: Run Redis governance tests
deps: [restore]
cmds:
- dotnet test {{.GOVERNANCE_REDIS_TEST_PROJECT}} -c {{.CONFIGURATION}} --no-restore

test:smoke:
desc: Run example smoke tests
deps: [restore]
cmds:
- dotnet test {{.SMOKE_TEST_PROJECT}} -c {{.CONFIGURATION}} --no-restore

test:project:
desc: Run a specific test project with an optional filter
deps: [restore]
preconditions:
- sh: test -n "{{.PROJECT}}"
msg: 'PROJECT is required. Example: task test:project PROJECT=Tests/ModularityKit.Mutator.Tests/ModularityKit.Mutator.Tests.csproj'
cmds:
- >
dotnet test {{.PROJECT}} -c {{.CONFIGURATION}} --no-restore{{if .FILTER}} --filter "{{.FILTER}}"{{end}}

format:
desc: Format the solution
deps: [restore]
cmds:
- dotnet format {{.SOLUTION}}

deps:
desc: Run dependency health checks
deps: [restore]
cmds:
- python3 -m scripts.dependencies.check_package_health --solution {{.SOLUTION}}

docs:
desc: Build the DocFX site
cmds:
- dotnet tool update -g docfx
- dotnet build {{.SOLUTION}} -c {{.CONFIGURATION}}
- docfx docfx.json

verify:
desc: Run the common local verification workflow
deps:
- build
- deps
- test
2 changes: 2 additions & 0 deletions src/ModularityKit.Mutator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<ItemGroup>
<Compile Remove="Governance/**/*.cs" />
<Compile Remove="Redis/**/*.cs" />
<Compile Remove="obj/**/*.cs" />
<Compile Remove="bin/**/*.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading