-
Notifications
You must be signed in to change notification settings - Fork 48
146 lines (123 loc) · 4.46 KB
/
Copy pathci.yml
File metadata and controls
146 lines (123 loc) · 4.46 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
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Desktop Swift (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15, ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Fetch Commander dependency
shell: bash
run: git clone --depth 1 https://github.com/steipete/Commander.git ../Commander
- name: Select Xcode 26.1
if: runner.os == 'macOS'
run: sudo xcode-select -s /Applications/Xcode_26.1.app || sudo xcode-select -s /Applications/Xcode_26.0.app || sudo xcode-select -s /Applications/Xcode.app
- name: Install Swift toolchain (macOS/Linux)
if: runner.os != 'Windows'
uses: SwiftyLab/setup-swift@v1
with:
swift-version: '6.2.1'
- name: Cache Swift Package Manager
uses: actions/cache@v6
with:
path: |
.build
~/.cache/org.swift.swiftpm
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build
run: swift build -c release --verbose
- name: Run Tests (Unit Tests Only)
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
# Several test suites mutate process-wide env/profile state.
swift test --no-parallel --filter TachikomaTests --skip "OpenAIAudioProviderTests" --skip "ProviderEndToEndTests"
else
swift test --filter TachikomaTests
fi
env:
TACHIKOMA_DISABLE_API_TESTS: "true"
TACHIKOMA_TEST_MODE: "mock"
continue-on-error: true
- name: Run Package Tests (Full API Testing)
run: swift test --verbose
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
X_AI_API_KEY: ${{ secrets.X_AI_API_KEY }}
XAI_API_KEY: ${{ secrets.X_AI_API_KEY }}
continue-on-error: true
build-examples:
name: Build Examples on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [macos-15]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Fetch Commander dependency
shell: bash
run: git clone --depth 1 https://github.com/steipete/Commander.git ../Commander
- name: Select Xcode 26.1
if: runner.os == 'macOS'
run: sudo xcode-select -s /Applications/Xcode_26.1.app || sudo xcode-select -s /Applications/Xcode_26.0.app || sudo xcode-select -s /Applications/Xcode.app
- name: Install Swift toolchain (macOS/Linux)
if: runner.os != 'Windows'
uses: SwiftyLab/setup-swift@v1
with:
swift-version: '6.2.1'
- name: Build Examples
run: |
# Build once in debug to ensure module artifacts land in the standard
# .build/<triple>/debug location, which we can point swiftc at.
DEBUG_BIN=$(swift build --package-path . --show-bin-path)
INCLUDE_FLAGS="-I $DEBUG_BIN"
# If a release build already exists, add it too so we pick up any
# optimized module outputs from caches.
RELEASE_BIN=${DEBUG_BIN%/debug}/release
if [ -d "$RELEASE_BIN" ]; then
INCLUDE_FLAGS="$INCLUDE_FLAGS -I $RELEASE_BIN"
fi
find Examples -name "*.swift" -exec swiftc $INCLUDE_FLAGS -typecheck {} \;
find Examples -name "*_demo.swift" -exec swiftc $INCLUDE_FLAGS -typecheck {} \;
find Examples -name "*_examples.swift" -exec swiftc $INCLUDE_FLAGS -typecheck {} \;
apple-simulators:
# Disabled for now: simulator SDK downloads are slow/flaky and not needed for core validation.
if: false
name: Apple Platforms (${{ matrix.platform }})
runs-on: macos-15
needs: test
strategy:
matrix:
platform: ["iOS Simulator"]
steps:
- run: echo "skipped"
lint:
name: SwiftLint
runs-on: macos-15
# SwiftLint only runs on macOS
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install SwiftLint
run: brew install swiftlint
- name: SwiftLint
run: swiftlint --config .swiftlint.yml --strict
continue-on-error: true # Don't fail CI on lint issues initially