Skip to content

Commit 2703e85

Browse files
Copilotfriggeri
andcommitted
Split into separate workflows per SDK with native path filtering
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
1 parent dcf28b0 commit 2703e85

File tree

5 files changed

+276
-269
lines changed

5 files changed

+276
-269
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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

.github/workflows/go-sdk-tests.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Go SDK Tests"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'go/**'
7+
- 'test/**'
8+
- 'nodejs/package.json'
9+
- '.github/workflows/go-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: "Go 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: ./go
29+
steps:
30+
- uses: actions/checkout@v6.0.2
31+
- uses: ./.github/actions/setup-copilot
32+
id: setup-copilot
33+
- uses: actions/setup-go@v6
34+
with:
35+
go-version: "1.23"
36+
37+
- name: Run go fmt
38+
if: runner.os == 'Linux'
39+
working-directory: ./go
40+
run: |
41+
go fmt ./...
42+
if [ -n "$(git status --porcelain)" ]; then
43+
echo "❌ go fmt produced changes. Please run 'go fmt ./...' in go"
44+
git --no-pager diff
45+
exit 1
46+
fi
47+
echo "✅ go fmt produced no changes"
48+
49+
- name: Install golangci-lint
50+
if: runner.os == 'Linux'
51+
uses: golangci/golangci-lint-action@v9
52+
with:
53+
working-directory: ./go
54+
version: latest
55+
args: --timeout=5m
56+
57+
- name: Install test harness dependencies
58+
working-directory: ./test/harness
59+
run: npm ci --ignore-scripts
60+
61+
- name: Warm up PowerShell
62+
if: runner.os == 'Windows'
63+
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
64+
65+
- name: Run Go SDK tests
66+
env:
67+
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
68+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
69+
run: /bin/bash test.sh
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Node.js SDK Tests"
2+
3+
env:
4+
HUSKY: 0
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- 'nodejs/**'
10+
- 'test/**'
11+
- '.github/workflows/nodejs-sdk-tests.yml'
12+
- '.github/actions/setup-copilot/**'
13+
workflow_dispatch:
14+
merge_group:
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test:
21+
name: "Node.js SDK Tests"
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-latest, macos-latest, windows-latest]
26+
runs-on: ${{ matrix.os }}
27+
defaults:
28+
run:
29+
shell: bash
30+
working-directory: ./nodejs
31+
steps:
32+
- uses: actions/checkout@v6.0.2
33+
- uses: actions/setup-node@v6
34+
with:
35+
cache: "npm"
36+
cache-dependency-path: "./nodejs/package-lock.json"
37+
node-version: 22
38+
- uses: ./.github/actions/setup-copilot
39+
id: setup-copilot
40+
- name: Install dependencies
41+
run: npm ci --ignore-scripts
42+
43+
- name: Run prettier check
44+
if: runner.os == 'Linux'
45+
run: npm run format:check
46+
47+
- name: Run ESLint
48+
run: npm run lint
49+
50+
- name: Typecheck SDK
51+
run: npm run typecheck
52+
53+
- name: Install test harness dependencies
54+
working-directory: ./test/harness
55+
run: npm ci --ignore-scripts
56+
57+
- name: Warm up PowerShell
58+
if: runner.os == 'Windows'
59+
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
60+
61+
- name: Run Node.js SDK tests
62+
env:
63+
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
64+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
65+
run: npm test
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Python SDK Tests"
2+
3+
env:
4+
PYTHONUTF8: 1
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- 'python/**'
10+
- 'test/**'
11+
- 'nodejs/package.json'
12+
- '.github/workflows/python-sdk-tests.yml'
13+
- '.github/actions/setup-copilot/**'
14+
workflow_dispatch:
15+
merge_group:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
test:
22+
name: "Python SDK Tests"
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-latest, macos-latest, windows-latest]
27+
runs-on: ${{ matrix.os }}
28+
defaults:
29+
run:
30+
shell: bash
31+
working-directory: ./python
32+
steps:
33+
- uses: actions/checkout@v6.0.2
34+
- uses: ./.github/actions/setup-copilot
35+
id: setup-copilot
36+
- uses: actions/setup-python@v6
37+
with:
38+
python-version: "3.12"
39+
40+
- name: Set up uv
41+
uses: astral-sh/setup-uv@v7
42+
with:
43+
enable-cache: true
44+
45+
- name: Install Python dev dependencies
46+
run: uv sync --locked --all-extras --dev
47+
48+
- name: Run ruff format check
49+
run: uv run ruff format --check .
50+
51+
- name: Run ruff lint
52+
run: uv run ruff check
53+
54+
- name: Run ty type checking
55+
run: uv run ty check copilot
56+
57+
- name: Install test harness dependencies
58+
working-directory: ./test/harness
59+
run: npm ci --ignore-scripts
60+
61+
- name: Warm up PowerShell
62+
if: runner.os == 'Windows'
63+
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
64+
65+
- name: Run Python SDK tests
66+
env:
67+
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
68+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
69+
run: uv run pytest -v -s

0 commit comments

Comments
 (0)