-
Notifications
You must be signed in to change notification settings - Fork 1.3k
218 lines (185 loc) · 5.78 KB
/
Copy pathsdk-e2e-tests.yml
File metadata and controls
218 lines (185 loc) · 5.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: "SDK E2E Tests"
env:
HUSKY: 0
PYTHONUTF8: 1
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
merge_group:
permissions:
contents: read
jobs:
nodejs-sdk:
name: "Node.js SDK Tests"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: ./nodejs
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
cache: "npm"
cache-dependency-path: "./nodejs/package-lock.json"
node-version: 22
- uses: ./.github/actions/setup-copilot
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run prettier check
if: runner.os == 'Linux'
run: npm run format:check
- name: Run ESLint
run: npm run lint
- name: Typecheck SDK
run: npm run typecheck
- 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 Node.js SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: npm test
go-sdk:
name: "Go SDK Tests"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: ./go
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-copilot
- uses: actions/setup-go@v6
with:
go-version: "1.23"
- name: Run go fmt
if: runner.os == 'Linux'
working-directory: ./go
run: |
go fmt ./...
if [ -n "$(git status --porcelain)" ]; then
echo "❌ go fmt produced changes. Please run 'go fmt ./...' in go"
git --no-pager diff
exit 1
fi
echo "✅ go fmt produced no changes"
- name: Install golangci-lint
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v9
with:
working-directory: ./go
version: latest
args: --timeout=5m
- 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 Go SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: /bin/bash test.sh
python-sdk:
name: "Python SDK Tests"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: ./python
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-copilot
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Python dev dependencies
run: uv sync --locked --all-extras --dev
- name: Run ruff format check
run: uv run ruff format --check .
- name: Run ruff lint
run: uv run ruff check
- name: Run ty type checking
run: uv run ty check copilot
- 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 Python SDK tests
env:
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
run: uv run pytest -v -s
dotnet-sdk:
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/checkout@v6
- uses: ./.github/actions/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 }}
run: dotnet test --no-build -v n