| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- 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
- 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
|