-
Notifications
You must be signed in to change notification settings - Fork 909
132 lines (112 loc) · 4.42 KB
/
ci.yml
File metadata and controls
132 lines (112 loc) · 4.42 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
name: CI
on:
push:
branches: ["*"]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-build-test:
runs-on: macos-15-intel
timeout-minutes: 35
steps:
- uses: actions/checkout@v6
- name: Select Xcode 26.1.1 (if present) or fallback to default
run: |
set -euo pipefail
for candidate in /Applications/Xcode_26.1.1.app /Applications/Xcode_26.1.app /Applications/Xcode.app; do
if [[ -d "$candidate" ]]; then
sudo xcode-select -s "${candidate}/Contents/Developer"
echo "DEVELOPER_DIR=${candidate}/Contents/Developer" >> "$GITHUB_ENV"
break
fi
done
/usr/bin/xcodebuild -version
- name: Swift toolchain version
run: |
set -euo pipefail
swift --version
swift package --version
- name: Install lint tools
run: ./Scripts/install_lint_tools.sh
- name: Lint
run: ./Scripts/lint.sh lint
- name: Swift Test
timeout-minutes: 25
run: |
swift test --parallel \
--skip ClaudeOAuthCredentialsStoreSecurityCLITests \
--skip CLIOpenAIDashboardCacheTests \
--skip CodexAccountScopedRefreshDashboardCleanupTests \
--skip CodexAccountScopedRefreshTests \
--skip CodexDashboardWorkedExampleParityTests \
--skip CodexWebDashboardStrategyAuthorityTests \
--skip OpenAIDashboardNavigationDelegateTests \
--skip StatusMenuTokenAccountSwitcherTests \
--skip SubprocessRunnerTests
swift test --no-parallel \
--filter 'ClaudeOAuthCredentialsStoreSecurityCLITests|CLIOpenAIDashboardCacheTests|CodexAccountScopedRefreshDashboardCleanupTests|CodexAccountScopedRefreshTests|CodexDashboardWorkedExampleParityTests|CodexWebDashboardStrategyAuthorityTests|OpenAIDashboardNavigationDelegateTests|SubprocessRunnerTests'
build-linux-cli:
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- name: linux-x64
runs-on: ubuntu-24.04
- name: linux-arm64
runs-on: ubuntu-24.04-arm
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v6
- name: Runner info
run: |
set -euo pipefail
uname -a
uname -m
- name: Install Swift 6.2.1 via swiftly
shell: bash
run: |
set -euo pipefail
if ! command -v gpg >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y ca-certificates gpg
fi
SWIFTLY_ARCH="$(uname -m)"
SWIFTLY_HOME_DIR="$HOME/.local/share/swiftly"
SWIFTLY_BIN_DIR="$HOME/.local/bin"
POST_INSTALL_SCRIPT="$(mktemp)"
mkdir -p "$SWIFTLY_BIN_DIR"
curl -fsSL "https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_ARCH}.tar.gz" -o /tmp/swiftly.tar.gz
tar -xzf /tmp/swiftly.tar.gz -C /tmp
/tmp/swiftly init --assume-yes --skip-install
. "$SWIFTLY_HOME_DIR/env.sh"
echo "$SWIFTLY_BIN_DIR" >> "$GITHUB_PATH"
echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV"
echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"
swiftly install 6.2.1 --use --assume-yes --post-install-file "$POST_INSTALL_SCRIPT"
if [[ -s "$POST_INSTALL_SCRIPT" ]]; then
sudo apt-get update
sudo bash "$POST_INSTALL_SCRIPT"
fi
hash -r
swift --version
- name: Build CodexBarCLI (release, static Swift stdlib)
run: swift build -c release --product CodexBarCLI --static-swift-stdlib
- name: Swift Test (Linux only)
run: swift test --parallel
- name: Smoke test CodexBarCLI
shell: bash
run: |
set -euo pipefail
BIN_DIR="$(swift build -c release --product CodexBarCLI --static-swift-stdlib --show-bin-path)"
BIN="$BIN_DIR/CodexBarCLI"
"$BIN" --help >/dev/null
"$BIN" --version >/dev/null
if "$BIN" usage --provider codex --web >/dev/null 2>&1; then
echo "Expected --web to fail on Linux"
exit 1
fi
"$BIN" usage --provider codex --web 2>&1 | tee /tmp/codexbarcli-stderr.txt >/dev/null || true
grep -q "macOS" /tmp/codexbarcli-stderr.txt