-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (62 loc) · 2 KB
/
build-test.yml
File metadata and controls
74 lines (62 loc) · 2 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
name: "Build & Test"
env:
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
on:
schedule:
# Run once a day at 00:00 UTC
- cron: '0 0 * * *'
push:
branches: [main]
pull_request:
workflow_dispatch:
merge_group:
permissions:
contents: read
jobs:
java-sdk:
name: "Java SDK Tests"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
- uses: actions/setup-java@v5
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
- name: Run spotless check
run: |
mvn spotless:check
if [ $? -ne 0 ]; then
echo "❌ spotless:check failed. Please run 'mvn spotless:apply' in java"
exit 1
fi
echo "✅ spotless:check passed"
- name: Build SDK and clone test harness
run: mvn test-compile
- name: Verify Javadoc generation
run: mvn javadoc:javadoc -q
- name: Install Copilot CLI from cloned SDK
id: setup-copilot
run: |
# Install dependencies in the cloned SDK's nodejs directory
# This ensures we use the same CLI version as the test harness expects
cd target/copilot-sdk/nodejs
npm ci --ignore-scripts
echo "path=$(pwd)/node_modules/@github/copilot/index.js" >> $GITHUB_OUTPUT
- name: Verify CLI works
run: node ${{ steps.setup-copilot.outputs.path }} --version
- name: Run Java SDK tests
env:
# Set CI=false to bypass a JSON parsing bug in the upstream SDK test harness
# (replayingCapiProxy.ts:260-266 emitNoMatchingRequestWarning with empty body)
# This can be removed once the upstream issue is fixed.
CI: "false"
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.path }}
run: mvn verify