Skip to content

Commit eaabff6

Browse files
CopilotMalcolmnixon
andcommitted
Synchronize with TemplateDotNetTool template PRs #29, #31, #32, #35
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 269a018 commit eaabff6

File tree

4 files changed

+119
-82
lines changed

4 files changed

+119
-82
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
]
4040
},
4141
"demaconsulting.buildmark": {
42-
"version": "0.2.0",
42+
"version": "0.3.0",
4343
"commands": [
4444
"buildmark"
4545
]

.github/workflows/build.yaml

Lines changed: 97 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,12 @@ jobs:
351351
contents: read
352352

353353
steps:
354+
# === CHECKOUT AND DOWNLOAD ARTIFACTS ===
355+
# This section retrieves the code and all necessary artifacts from previous jobs.
356+
354357
- name: Checkout
355358
uses: actions/checkout@v6
356359

357-
- name: Setup Node.js
358-
uses: actions/setup-node@v6
359-
with:
360-
node-version: 'lts/*'
361-
362360
- name: Download all test results
363361
uses: actions/download-artifact@v7
364362
with:
@@ -385,6 +383,14 @@ jobs:
385383
pattern: 'version-capture-*'
386384
continue-on-error: true
387385

386+
# === INSTALL DEPENDENCIES ===
387+
# This section installs all required dependencies and tools for document generation.
388+
389+
- name: Setup Node.js
390+
uses: actions/setup-node@v6
391+
with:
392+
node-version: 'lts/*'
393+
388394
- name: Setup dotnet
389395
uses: actions/setup-dotnet@v5
390396
with:
@@ -405,6 +411,9 @@ jobs:
405411
- name: Restore Tools
406412
run: dotnet tool restore
407413

414+
# === CAPTURE TOOL VERSIONS ===
415+
# This section captures the versions of all tools used in the build process.
416+
408417
- name: Capture tool versions for build-docs
409418
shell: bash
410419
run: |
@@ -413,6 +422,9 @@ jobs:
413422
dotnet git node npm pandoc weasyprint sarifmark reqstream buildmark versionmark
414423
echo "✓ Tool versions captured"
415424
425+
# === GENERATE MARKDOWN REPORTS ===
426+
# This section generates all markdown reports from various tools and sources.
427+
416428
- name: Generate Requirements Report and Trace Matrix
417429
run: >
418430
dotnet reqstream
@@ -438,70 +450,6 @@ jobs:
438450
echo "=== CodeQL Quality Report ==="
439451
cat docs/quality/codeql-quality.md
440452
441-
- name: Generate HTML with Pandoc
442-
run: >
443-
dotnet pandoc
444-
--defaults docs/guide/definition.yaml
445-
--filter node_modules/.bin/mermaid-filter.cmd
446-
--metadata version="${{ inputs.version }}"
447-
--metadata date="$(date +'%Y-%m-%d')"
448-
--output docs/guide/guide.html
449-
450-
- name: Generate PDF with Weasyprint
451-
run: >
452-
dotnet weasyprint
453-
--pdf-variant pdf/a-3u
454-
docs/guide/guide.html
455-
"docs/SonarMark User Guide.pdf"
456-
457-
- name: Generate Requirements HTML with Pandoc
458-
run: >
459-
dotnet pandoc
460-
--defaults docs/requirements/definition.yaml
461-
--filter node_modules/.bin/mermaid-filter.cmd
462-
--metadata version="${{ inputs.version }}"
463-
--metadata date="$(date +'%Y-%m-%d')"
464-
--output docs/requirements/requirements.html
465-
466-
- name: Generate Requirements PDF with Weasyprint
467-
run: >
468-
dotnet weasyprint
469-
--pdf-variant pdf/a-3u
470-
docs/requirements/requirements.html
471-
"docs/SonarMark Requirements.pdf"
472-
473-
- name: Generate Trace Matrix HTML with Pandoc
474-
run: >
475-
dotnet pandoc
476-
--defaults docs/tracematrix/definition.yaml
477-
--filter node_modules/.bin/mermaid-filter.cmd
478-
--metadata version="${{ inputs.version }}"
479-
--metadata date="$(date +'%Y-%m-%d')"
480-
--output docs/tracematrix/tracematrix.html
481-
482-
- name: Generate Trace Matrix PDF with Weasyprint
483-
run: >
484-
dotnet weasyprint
485-
--pdf-variant pdf/a-3u
486-
docs/tracematrix/tracematrix.html
487-
"docs/SonarMark Trace Matrix.pdf"
488-
489-
- name: Generate Justifications HTML with Pandoc
490-
run: >
491-
dotnet pandoc
492-
--defaults docs/justifications/definition.yaml
493-
--filter node_modules/.bin/mermaid-filter.cmd
494-
--metadata version="${{ inputs.version }}"
495-
--metadata date="$(date +'%Y-%m-%d')"
496-
--output docs/justifications/justifications.html
497-
498-
- name: Generate Justifications PDF with Weasyprint
499-
run: >
500-
dotnet weasyprint
501-
--pdf-variant pdf/a-3u
502-
docs/justifications/justifications.html
503-
"docs/SonarMark Requirements Justifications.pdf"
504-
505453
- name: Generate Code Quality Report with SonarMark
506454
shell: bash
507455
env:
@@ -536,11 +484,6 @@ jobs:
536484
run: |
537485
echo "=== Build Notes Report ==="
538486
cat docs/buildnotes.md
539-
# Verify buildnotes.md was created
540-
if [ ! -f "docs/buildnotes.md" ]; then
541-
echo "Error: buildnotes.md was not created"
542-
exit 1
543-
fi
544487
545488
- name: Publish Tool Versions
546489
shell: bash
@@ -556,6 +499,45 @@ jobs:
556499
echo "=== Tool Versions Report ==="
557500
cat docs/buildnotes/versions.md
558501
502+
# === GENERATE HTML DOCUMENTS WITH PANDOC ===
503+
# This section converts markdown documents to HTML using Pandoc.
504+
505+
- name: Generate Guide HTML with Pandoc
506+
run: >
507+
dotnet pandoc
508+
--defaults docs/guide/definition.yaml
509+
--filter node_modules/.bin/mermaid-filter.cmd
510+
--metadata version="${{ inputs.version }}"
511+
--metadata date="$(date +'%Y-%m-%d')"
512+
--output docs/guide/guide.html
513+
514+
- name: Generate Requirements HTML with Pandoc
515+
run: >
516+
dotnet pandoc
517+
--defaults docs/requirements/definition.yaml
518+
--filter node_modules/.bin/mermaid-filter.cmd
519+
--metadata version="${{ inputs.version }}"
520+
--metadata date="$(date +'%Y-%m-%d')"
521+
--output docs/requirements/requirements.html
522+
523+
- name: Generate Trace Matrix HTML with Pandoc
524+
run: >
525+
dotnet pandoc
526+
--defaults docs/tracematrix/definition.yaml
527+
--filter node_modules/.bin/mermaid-filter.cmd
528+
--metadata version="${{ inputs.version }}"
529+
--metadata date="$(date +'%Y-%m-%d')"
530+
--output docs/tracematrix/tracematrix.html
531+
532+
- name: Generate Justifications HTML with Pandoc
533+
run: >
534+
dotnet pandoc
535+
--defaults docs/justifications/definition.yaml
536+
--filter node_modules/.bin/mermaid-filter.cmd
537+
--metadata version="${{ inputs.version }}"
538+
--metadata date="$(date +'%Y-%m-%d')"
539+
--output docs/justifications/justifications.html
540+
559541
- name: Generate Build Notes HTML with Pandoc
560542
shell: bash
561543
run: >
@@ -566,13 +548,6 @@ jobs:
566548
--filter node_modules/.bin/mermaid-filter.cmd
567549
--output docs/buildnotes/buildnotes.html
568550
569-
- name: Convert Build Notes HTML to PDF with Weasyprint
570-
run: >
571-
dotnet weasyprint
572-
--pdf-variant pdf/a-3u
573-
docs/buildnotes/buildnotes.html
574-
"docs/SonarMark Build Notes.pdf"
575-
576551
- name: Generate Code Quality HTML with Pandoc
577552
run: >
578553
dotnet pandoc
@@ -582,13 +557,54 @@ jobs:
582557
--metadata date="$(date +'%Y-%m-%d')"
583558
--output docs/quality/quality.html
584559
560+
# === GENERATE PDF DOCUMENTS WITH WEASYPRINT ===
561+
# This section converts HTML documents to PDF using Weasyprint.
562+
563+
- name: Generate Guide PDF with Weasyprint
564+
run: >
565+
dotnet weasyprint
566+
--pdf-variant pdf/a-3u
567+
docs/guide/guide.html
568+
"docs/SonarMark User Guide.pdf"
569+
570+
- name: Generate Requirements PDF with Weasyprint
571+
run: >
572+
dotnet weasyprint
573+
--pdf-variant pdf/a-3u
574+
docs/requirements/requirements.html
575+
"docs/SonarMark Requirements.pdf"
576+
577+
- name: Generate Trace Matrix PDF with Weasyprint
578+
run: >
579+
dotnet weasyprint
580+
--pdf-variant pdf/a-3u
581+
docs/tracematrix/tracematrix.html
582+
"docs/SonarMark Trace Matrix.pdf"
583+
584+
- name: Generate Justifications PDF with Weasyprint
585+
run: >
586+
dotnet weasyprint
587+
--pdf-variant pdf/a-3u
588+
docs/justifications/justifications.html
589+
"docs/SonarMark Requirements Justifications.pdf"
590+
591+
- name: Generate Build Notes PDF with Weasyprint
592+
run: >
593+
dotnet weasyprint
594+
--pdf-variant pdf/a-3u
595+
docs/buildnotes/buildnotes.html
596+
"docs/SonarMark Build Notes.pdf"
597+
585598
- name: Generate Code Quality PDF with Weasyprint
586599
run: >
587600
dotnet weasyprint
588601
--pdf-variant pdf/a-3u
589602
docs/quality/quality.html
590603
"docs/SonarMark Code Quality.pdf"
591604
605+
# === UPLOAD ARTIFACTS ===
606+
# This section uploads all generated documentation artifacts.
607+
592608
- name: Upload documentation
593609
uses: actions/upload-artifact@v6
594610
with:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ docs/justifications/*.html
5656
docs/quality/sonar-quality.md
5757
docs/quality/codeql-quality.md
5858
docs/quality/*.html
59+
docs/buildnotes.md
5960
docs/buildnotes/versions.md
61+
62+
# VersionMark captures (generated during CI/CD)
63+
versionmark-*.json

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,23 @@ SonarQube/SonarCloud analysis results.
3131
- Enforced in CI: `dotnet reqstream --requirements requirements.yaml --tests "test-results/**/*.trx" --enforce`
3232
- When adding features: add requirement + link to test
3333

34+
## Test Source Filters
35+
36+
Test links in `requirements.yaml` can include a source filter prefix to restrict which test results count as
37+
evidence. This is critical for platform and framework requirements - **do not remove these filters**.
38+
39+
- `windows@TestName` - proves the test passed on a Windows platform
40+
- `ubuntu@TestName` - proves the test passed on a Linux (Ubuntu) platform
41+
- `net8.0@TestName` - proves the test passed under the .NET 8 target framework
42+
- `net9.0@TestName` - proves the test passed under the .NET 9 target framework
43+
- `net10.0@TestName` - proves the test passed under the .NET 10 target framework
44+
- `dotnet8.x@TestName` - proves the self-validation test ran on a machine with .NET 8.x runtime
45+
- `dotnet9.x@TestName` - proves the self-validation test ran on a machine with .NET 9.x runtime
46+
- `dotnet10.x@TestName` - proves the self-validation test ran on a machine with .NET 10.x runtime
47+
48+
Without the source filter, a test result from any platform/framework satisfies the requirement. Adding the
49+
filter ensures the CI evidence comes specifically from the required environment.
50+
3451
## Testing (SonarMark-Specific)
3552

3653
- **Test Naming**: `ClassName_MethodUnderTest_Scenario_ExpectedBehavior` (for requirements traceability)

0 commit comments

Comments
 (0)