-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
74 lines (57 loc) · 2.32 KB
/
justfile
File metadata and controls
74 lines (57 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
set shell := ["sh", "-c"]
set windows-shell := ["pwsh", "-NoLogo", "-Command"]
# Show all available tasks
_default:
@just --list
# Build the solution
build:
dotnet build --no-restore --configuration Release
# Run all tests with code coverage
test target-framework="net8.0":
dotnet test --collect:"XPlat Code Coverage" --logger "trx" --logger "console;verbosity=normal" --no-build --configuration Release --results-directory ./test-results --framework {{target-framework}}
echo "\nCoverage report (summary):"
dotnet reportgenerator -reports:**/coverage.cobertura.xml -targetdir:coverage-report -reporttypes:MarkdownSummary || echo "Install reportgenerator for coverage summary."
# Convert test results to JUnit format
convert-test-results:
dotnet trx2junit ./test-results/*.trx --output ./test-results/
# Package the solution into NuGet package(s)
package:
dotnet pack --no-build --configuration Release --output ./artifacts
# Format all code using dotnet format
format:
dotnet format
# Restore all NuGet packages and tools
restore:
dotnet restore
dotnet tool restore
# Clean build outputs
clean:
dotnet clean
# Clear test results directory
[unix]
clear-test-results:
rm -rf ./test-results || echo "No test results to clear."
# Clear test results directory
[windows]
clear-test-results:
rmdir /s /q .\test-results || echo "No test results to clear."
# Clean all NuGet caches
clean-nuget-cache:
dotnet nuget locals all --clear
# Run restore, build, and test in sequence
build-and-test: clean clear-test-results restore build test convert-test-results
# Watch for file changes and run all tests automatically
watch-test:
# Requires entr (nix: pkgs.entr)
find . -type f \( -name '*.cs' -o -name '*.csproj' \) | entr -c just test
# Show the current version of the project
version:
@dotnet gitversion /output json /showvariable MajorMinorPatch
# Run act workflow locally
run-act:
@act push -s GITHUB_TOKEN="$(gh auth token)" --artifact-server-path $PWD/.artifacts
# Add a NuGet source for GitHub Packages
add-github-nuget-source username password org="machinology":
@dotnet nuget add source --username {{username}} --password {{password}} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/{{org}}/index.json"
# Alias for build-and-test
alias b := build-and-test