|
| 1 | +name: ".NET SDK Tests" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - 'dotnet/**' |
| 7 | + - 'test/**' |
| 8 | + - 'nodejs/package.json' |
| 9 | + - '.github/workflows/dotnet-sdk-tests.yml' |
| 10 | + - '.github/actions/setup-copilot/**' |
| 11 | + workflow_dispatch: |
| 12 | + merge_group: |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +jobs: |
| 18 | + test: |
| 19 | + name: ".NET SDK Tests" |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + defaults: |
| 26 | + run: |
| 27 | + shell: bash |
| 28 | + working-directory: ./dotnet |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v6.0.2 |
| 31 | + - uses: ./.github/actions/setup-copilot |
| 32 | + id: setup-copilot |
| 33 | + - uses: actions/setup-dotnet@v5 |
| 34 | + with: |
| 35 | + dotnet-version: "8.0.x" |
| 36 | + - uses: actions/setup-node@v6 |
| 37 | + with: |
| 38 | + cache: "npm" |
| 39 | + cache-dependency-path: "./nodejs/package-lock.json" |
| 40 | + |
| 41 | + - name: Install Node.js dependencies (for CLI) |
| 42 | + working-directory: ./nodejs |
| 43 | + run: npm ci --ignore-scripts |
| 44 | + |
| 45 | + - name: Restore .NET dependencies |
| 46 | + run: dotnet restore |
| 47 | + |
| 48 | + - name: Run dotnet format check |
| 49 | + if: runner.os == 'Linux' |
| 50 | + run: | |
| 51 | + dotnet format --verify-no-changes |
| 52 | + if [ $? -ne 0 ]; then |
| 53 | + echo "❌ dotnet format produced changes. Please run 'dotnet format' in dotnet" |
| 54 | + exit 1 |
| 55 | + fi |
| 56 | + echo "✅ dotnet format produced no changes" |
| 57 | +
|
| 58 | + - name: Build SDK |
| 59 | + run: dotnet build --no-restore |
| 60 | + |
| 61 | + - name: Install test harness dependencies |
| 62 | + working-directory: ./test/harness |
| 63 | + run: npm ci --ignore-scripts |
| 64 | + |
| 65 | + - name: Warm up PowerShell |
| 66 | + if: runner.os == 'Windows' |
| 67 | + run: pwsh.exe -Command "Write-Host 'PowerShell ready'" |
| 68 | + |
| 69 | + - name: Run .NET SDK tests |
| 70 | + env: |
| 71 | + COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }} |
| 72 | + COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }} |
| 73 | + run: dotnet test --no-build -v n |
0 commit comments