Skip to content

Commit 13a675d

Browse files
CopilotMalcolmnixon
andcommitted
integration-test: add section comments, consolidate artifacts into single upload
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent bdc3c35 commit 13a675d

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

.github/workflows/build.yaml

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ jobs:
298298
dotnet-version: ['8.x', '9.x', '10.x']
299299

300300
steps:
301+
# === INSTALL DEPENDENCIES ===
302+
# This section installs all required dependencies and tools for integration testing.
303+
# Downstream projects: Add any additional dependency installations here.
304+
301305
- name: Checkout
302306
uses: actions/checkout@v6
303307
with:
@@ -329,6 +333,28 @@ jobs:
329333
--version ${{ inputs.version }} \
330334
DemaConsulting.TemplateDotNetTool
331335
336+
# === CAPTURE TOOL VERSIONS ===
337+
# This section captures the versions of all tools used in the integration tests.
338+
# Downstream projects: Add any additional tools to capture here.
339+
340+
- name: Capture tool versions
341+
shell: bash
342+
run: |
343+
mkdir -p artifacts
344+
echo "Capturing tool versions..."
345+
# Create short job ID: int-win-8, int-win-9, int-ubuntu-8, etc.
346+
OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/')
347+
DOTNET_SHORT=$(echo "${{ matrix.dotnet-version }}" | sed 's/\.x$//')
348+
JOB_ID="int-${OS_SHORT}-${DOTNET_SHORT}"
349+
dotnet versionmark --capture --job-id "${JOB_ID}" \
350+
--output "artifacts/versionmark-${JOB_ID}.json" -- \
351+
dotnet git versionmark
352+
echo "✓ Tool versions captured"
353+
354+
# === RUN INTEGRATION TESTS ===
355+
# This section runs the integration tests for the tool.
356+
# Downstream projects: Add any additional integration test steps here.
357+
332358
- name: Test version display
333359
shell: bash
334360
run: |
@@ -347,36 +373,21 @@ jobs:
347373
shell: bash
348374
run: |
349375
echo "Running self-validation..."
350-
templatetool --validate --results validation-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}.trx \
376+
templatetool --validate \
377+
--results artifacts/validation-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}.trx \
351378
|| { echo "✗ Self-validation failed"; exit 1; }
352379
echo "✓ Self-validation succeeded"
353380
354-
- name: Capture tool versions
355-
shell: bash
356-
run: |
357-
mkdir -p artifacts
358-
echo "Capturing tool versions..."
359-
# Create short job ID: int-win-8, int-win-9, int-ubuntu-8, etc.
360-
OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/')
361-
DOTNET_SHORT=$(echo "${{ matrix.dotnet-version }}" | sed 's/\.x$//')
362-
JOB_ID="int-${OS_SHORT}-${DOTNET_SHORT}"
363-
dotnet versionmark --capture --job-id "${JOB_ID}" \
364-
--output "artifacts/versionmark-${JOB_ID}.json" -- \
365-
dotnet git versionmark
366-
echo "✓ Tool versions captured"
367-
368-
- name: Upload version capture
369-
uses: actions/upload-artifact@v7
370-
with:
371-
name: artifacts-int-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
372-
path: artifacts/versionmark-int-*.json
381+
# === UPLOAD ARTIFACTS ===
382+
# This section uploads all generated artifacts for use by downstream jobs.
383+
# Downstream projects: Add any additional artifact uploads here.
373384

374-
- name: Upload validation test results
385+
- name: Upload validation artifacts
375386
if: always()
376387
uses: actions/upload-artifact@v7
377388
with:
378389
name: artifacts-validation-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
379-
path: validation-*.trx
390+
path: artifacts/
380391

381392
# Builds the supporting documentation including user guides, requirements,
382393
# trace matrices, code quality reports, and build notes.

0 commit comments

Comments
 (0)