Skip to content

Optimize CI: Split into separate workflows with native path filtering #1

Optimize CI: Split into separate workflows with native path filtering

Optimize CI: Split into separate workflows with native path filtering #1

name: ".NET SDK Tests"
on:
pull_request:
paths:
- 'dotnet/**'
- 'test/**'
- 'nodejs/package.json'
- '.github/workflows/dotnet-sdk-tests.yml'
- '.github/actions/setup-copilot/**'
workflow_dispatch:
merge_group:
permissions:
contents: read
jobs:
test:
name: ".NET SDK Tests"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: ./dotnet
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup-copilot
id: setup-copilot
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- uses: actions/setup-node@v6
with:
cache: "npm"
cache-dependency-path: "./nodejs/package-lock.json"
- name: Install Node.js dependencies (for CLI)
working-directory: ./nodejs
run: npm ci --ignore-scripts
- name: Restore .NET dependencies
run: dotnet restore
- name: Run dotnet format check
if: runner.os == 'Linux'
run: |
dotnet format --verify-no-changes
if [ $? -ne 0 ]; then
echo "❌ dotnet format produced changes. Please run 'dotnet format' in dotnet"
exit 1
fi
echo "✅ dotnet format produced no changes"
- name: Build SDK
run: dotnet build --no-restore
- name: Install test harness dependencies
working-directory: ./test/harness
run: npm ci --ignore-scripts
- name: Warm up PowerShell
if: runner.os == 'Windows'
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
- name: Run .NET SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
run: dotnet test --no-build -v n