name: Tests on: pull_request: workflow_dispatch: jobs: format: name: Format Check runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - name: Restore run: dotnet restore - name: Check Formatting run: dotnet format --verify-no-changes discovery-tests: name: Discovery Tests (${{ matrix.os }}) runs-on: ${{ matrix.os }} needs: format # Discovery runs on the machines being inventoried rather than on the RackPeek # host, so its tests are the ones that have to pass on every platform. They are # driven entirely from captured fixtures and never read the runner itself. # windows-latest joins this list when the Windows probe lands. strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] steps: - name: Checkout uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - name: Restore run: dotnet restore Tests.Discovery - name: Run Discovery Tests run: dotnet test Tests.Discovery --configuration Release --verbosity normal mcp-tests: name: MCP Tests runs-on: ubuntu-latest needs: format # Every MCP test is end-to-end: a real MCP client speaking streamable HTTP to the # real server over WebApplicationFactory, asserting on the YAML that lands on disk. steps: - name: Checkout uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - name: Restore run: dotnet restore Tests.Mcp - name: Run MCP Tests run: dotnet test Tests.Mcp --configuration Release --verbosity normal cli-tests: name: CLI Tests runs-on: ubuntu-latest needs: format steps: - name: Checkout uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - name: Restore run: dotnet restore - name: Build run: dotnet build --no-restore --configuration Release - name: Run CLI Tests run: dotnet test Tests --no-build --configuration Release --verbosity normal webui-tests: name: WebUI / Playwright Tests runs-on: ubuntu-24.04 needs: cli-tests steps: - name: Checkout uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - name: Cache NuGet uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/packages.lock.json') }} restore-keys: | ${{ runner.os }}-nuget- - name: Cache Playwright browsers uses: actions/cache@v4 with: path: ~/.cache/ms-playwright key: ${{ runner.os }}-pw-chromium-${{ hashFiles('**/*.csproj') }} restore-keys: | ${{ runner.os }}-pw-chromium- - name: Restore run: dotnet restore - name: Build run: dotnet build --no-restore --configuration Release - name: Install Playwright Browsers shell: bash run: | pwsh Tests.E2e/bin/Release/net*/playwright.ps1 install --with-deps chromium - name: Build Docker Image run: | docker build \ -t rackpeek:ci \ -f RackPeek.Web/Dockerfile \ . - name: Run E2E Tests run: dotnet test Tests.E2e --configuration Release --verbosity normal