-
Notifications
You must be signed in to change notification settings - Fork 99
165 lines (140 loc) · 5.37 KB
/
Copy pathci.yml
File metadata and controls
165 lines (140 loc) · 5.37 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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
style:
name: Style
runs-on: macos-26
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Run repository guardrails
run: make guardrails
- name: Test Xcode workspace generator
run: make xcode-generator-test
- name: Install Swift style tools
run: ./Scripts/install_format_tools.sh install
- name: Run Swift style lint
run: make lint
- name: Run conductor tests
run: make conductor-selftest
- name: Run release workflow tests
run: make release-selftest
build-and-test:
name: Build and Test (app shard ${{ matrix.shard }})
runs-on: macos-26
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Restore SwiftPM build cache
uses: actions/cache@v6
with:
path: |
.build
Packages/RepoPromptAgentProviders/.build
key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-${{ hashFiles('Package.swift', 'Package.resolved', 'Packages/RepoPromptAgentProviders/Package.swift', 'Packages/RepoPromptAgentProviders/Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-swiftpm-
- name: Build app product
run: swift build --product RepoPrompt
- name: Build MCP product
run: swift build --product repoprompt-mcp
- name: Run app tests
shell: bash
run: |
set -euo pipefail
# A single long-lived XCTest process accumulates suspended app-lifecycle tasks
# and can wedge Swift's cooperative executor late in the suite on hosted runners.
# Preserve serial test semantics while bounding each process to one small group.
# The runner auto-discovers the built .xctest bundle and invokes xcrun xctest
# directly, using ledger-backed runtime-balanced shards, slow-first ordering,
# and conservative batching only for fast stateless suites.
# Retry only silent startup timeouts; assertion failures fail fast in the runner.
python3 Scripts/ci_app_test_runner.py \
--suite-timeout-seconds 180 \
--silent-timeout-retries 1 \
--silent-startup-seconds 60 \
--ledger Scripts/Fixtures/test-suite-contract-ledger.tsv \
--strict-ledger \
--shard-count 4 \
--shard-index "${{ matrix.shard }}" \
--slow-first \
--batch-fast-suites \
--require-runtime-for-batching
sentry-enabled-build:
name: Sentry-enabled Build
runs-on: macos-26
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Restore SwiftPM build cache
uses: actions/cache@v6
with:
path: |
.build
Packages/RepoPromptAgentProviders/.build
key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-sentry-${{ hashFiles('Package.swift', 'Package.resolved', 'Packages/RepoPromptAgentProviders/Package.swift', 'Packages/RepoPromptAgentProviders/Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-swiftpm-
- name: Build app product with Sentry SDK linked
env:
REPOPROMPT_ENABLE_SENTRY: "1"
run: swift build --product RepoPrompt
- name: Test serialized Sentry privacy boundary
env:
REPOPROMPT_ENABLE_SENTRY: "1"
run: swift test --filter SentryTelemetryPrivacyTests
provider-tests:
name: Provider Tests
runs-on: macos-26
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Restore SwiftPM build cache
uses: actions/cache@v6
with:
path: |
.build
Packages/RepoPromptAgentProviders/.build
key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-provider-${{ hashFiles('Package.swift', 'Package.resolved', 'Packages/RepoPromptAgentProviders/Package.swift', 'Packages/RepoPromptAgentProviders/Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-swiftpm-
- name: Run provider package tests
working-directory: Packages/RepoPromptAgentProviders
run: swift test
secret-scan:
name: Secret Scan
runs-on: macos-26
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install gitleaks
run: brew install gitleaks
- name: Scan introduced commit range
env:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PUSH_BEFORE_SHA: ${{ github.event.before }}
CURRENT_SHA: ${{ github.sha }}
run: |
set -euo pipefail
if [[ "$EVENT_NAME" == "pull_request" ]]; then
range="$PR_BASE_SHA..$PR_HEAD_SHA"
elif [[ -n "$PUSH_BEFORE_SHA" && ! "$PUSH_BEFORE_SHA" =~ ^0+$ ]]; then
range="$PUSH_BEFORE_SHA..$CURRENT_SHA"
else
range="$CURRENT_SHA"
fi
gitleaks git --redact --log-opts="$range" .
- name: Scan checked-in source tree
run: gitleaks dir --redact .