Skip to content

Telemetry: service skeleton + slice 1 (TelemetryPolicyConfigured config-as-events) #143

Telemetry: service skeleton + slice 1 (TelemetryPolicyConfigured config-as-events)

Telemetry: service skeleton + slice 1 (TelemetryPolicyConfigured config-as-events) #143

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
# Cancel superseded PR runs; let `main` runs finish so we never lose a build
# of a merged commit.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# CI restores/builds/tests CritterCab.slnx explicitly (no glob), so the
# slnx is the single source of truth for what CI sees. A *.Tests.csproj
# added to disk but not hand-added to the slnx would silently never run
# and the check would still go green. This guard fails the build on that
# drift, keeping test discovery omission-proof as new services land.
- name: Verify solution completeness
shell: bash
run: |
missing=0
while IFS= read -r proj; do
rel="${proj#./}"
if ! grep -qF "$rel" CritterCab.slnx; then
echo "::error::Project '$rel' exists on disk but is not referenced in CritterCab.slnx"
missing=1
fi
done < <(find . -name '*.csproj')
if [ "$missing" -eq 0 ]; then
echo "All projects on disk are referenced in CritterCab.slnx."
fi
exit $missing
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props', '**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore CritterCab.slnx
- name: Build
run: dotnet build CritterCab.slnx --no-restore --configuration Release
- name: Test
run: >
dotnet test CritterCab.slnx
--no-build
--configuration Release
--logger "trx;LogFileName=test-results.trx"
--results-directory ./test-results
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./test-results
retention-days: 5